mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-22 19:21:09 +00:00
Update branch
This commit is contained in:
commit
bfdb26d779
596 changed files with 10214 additions and 3509 deletions
|
@ -1,6 +0,0 @@
|
|||
*.app
|
||||
*.debug
|
||||
*.profile
|
||||
*.palette
|
||||
*obj
|
||||
.gdbinit
|
99
.github/scripts/dependencies.sh
vendored
Executable file
99
.github/scripts/dependencies.sh
vendored
Executable file
|
@ -0,0 +1,99 @@
|
|||
#! /usr/bin/env sh
|
||||
|
||||
set -ex
|
||||
|
||||
install_gnustep_make() {
|
||||
echo "::group::GNUstep Make"
|
||||
cd $DEPS_PATH
|
||||
git clone -q -b ${TOOLS_MAKE_BRANCH:-master} https://github.com/gnustep/tools-make.git
|
||||
cd tools-make
|
||||
MAKE_OPTS=
|
||||
if [ -n "$HOST" ]; then
|
||||
MAKE_OPTS="$MAKE_OPTS --host=$HOST"
|
||||
fi
|
||||
if [ -n "$RUNTIME_VERSION" ]; then
|
||||
MAKE_OPTS="$MAKE_OPTS --with-runtime-abi=$RUNTIME_VERSION"
|
||||
fi
|
||||
./configure --prefix=$INSTALL_PATH --with-library-combo=$LIBRARY_COMBO $MAKE_OPTS || cat config.log
|
||||
make install
|
||||
|
||||
echo Objective-C build flags:
|
||||
$INSTALL_PATH/bin/gnustep-config --objc-flags
|
||||
echo "::endgroup::"
|
||||
}
|
||||
|
||||
install_libobjc2() {
|
||||
echo "::group::libobjc2"
|
||||
cd $DEPS_PATH
|
||||
git clone -q https://github.com/gnustep/libobjc2.git
|
||||
cd libobjc2
|
||||
git submodule sync
|
||||
git submodule update --init
|
||||
mkdir build
|
||||
cd build
|
||||
cmake \
|
||||
-DTESTS=off \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DGNUSTEP_INSTALL_TYPE=NONE \
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PATH \
|
||||
../
|
||||
make install
|
||||
echo "::endgroup::"
|
||||
}
|
||||
|
||||
install_libdispatch() {
|
||||
echo "::group::libdispatch"
|
||||
cd $DEPS_PATH
|
||||
# will reference upstream after https://github.com/apple/swift-corelibs-libdispatch/pull/534 is merged
|
||||
git clone -q -b system-blocksruntime https://github.com/ngrewe/swift-corelibs-libdispatch.git libdispatch
|
||||
mkdir libdispatch/build
|
||||
cd libdispatch/build
|
||||
# -Wno-error=void-pointer-to-int-cast to work around build error in queue.c due to -Werror
|
||||
cmake \
|
||||
-DBUILD_TESTING=off \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PATH \
|
||||
-DCMAKE_C_FLAGS="-Wno-error=void-pointer-to-int-cast" \
|
||||
-DINSTALL_PRIVATE_HEADERS=1 \
|
||||
-DBlocksRuntime_INCLUDE_DIR=$INSTALL_PATH/include \
|
||||
-DBlocksRuntime_LIBRARIES=$INSTALL_PATH/lib/libobjc.so \
|
||||
../
|
||||
make install
|
||||
echo "::endgroup::"
|
||||
}
|
||||
|
||||
install_gnustep_gui() {
|
||||
echo "::group::GNUstep GUI"
|
||||
cd $DEPS_PATH
|
||||
. $INSTALL_PATH/share/GNUstep/Makefiles/GNUstep.sh
|
||||
git clone -q -b ${LIBS_GUI_BRANCH:-master} https://github.com/gnustep/libs-gui.git
|
||||
cd libs-gui
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
echo "::endgroup::"
|
||||
}
|
||||
|
||||
install_gnustep_base() {
|
||||
echo "::group::GNUstep Base"
|
||||
cd $DEPS_PATH
|
||||
. $INSTALL_PATH/share/GNUstep/Makefiles/GNUstep.sh
|
||||
git clone -q -b ${LIBS_BASE_BRANCH:-master} https://github.com/gnustep/libs-base.git
|
||||
cd libs-base
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
echo "::endgroup::"
|
||||
}
|
||||
|
||||
mkdir -p $DEPS_PATH
|
||||
|
||||
# Windows MSVC toolchain uses tools-windows-msvc scripts to install non-GNUstep dependencies
|
||||
if [ "$LIBRARY_COMBO" = "ng-gnu-gnu" -a "$IS_WINDOWS_MSVC" != "true" ]; then
|
||||
install_libobjc2
|
||||
install_libdispatch
|
||||
fi
|
||||
|
||||
install_gnustep_make
|
||||
install_gnustep_base
|
||||
install_gnustep_gui
|
126
.github/workflows/main.yml
vendored
Normal file
126
.github/workflows/main.yml
vendored
Normal file
|
@ -0,0 +1,126 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tools_make_branch:
|
||||
description: "tools-make branch"
|
||||
default: "master"
|
||||
required: true
|
||||
libs_base_branch:
|
||||
description: "libs-base branch"
|
||||
default: "master"
|
||||
required: true
|
||||
libs_back_branch:
|
||||
description: "libs-back branch"
|
||||
default: "master"
|
||||
required: true
|
||||
|
||||
env:
|
||||
APT_PACKAGES: >-
|
||||
pkg-config
|
||||
libgnutls28-dev
|
||||
libffi-dev
|
||||
libicu-dev
|
||||
libxml2-dev
|
||||
libxslt1-dev
|
||||
libssl-dev
|
||||
libavahi-client-dev
|
||||
zlib1g-dev
|
||||
gnutls-bin
|
||||
libcurl4-gnutls-dev
|
||||
libgmp-dev
|
||||
libcairo2-dev
|
||||
|
||||
# packages for GCC Objective-C runtime
|
||||
APT_PACKAGES_gcc: >-
|
||||
libobjc-10-dev
|
||||
libblocksruntime-dev
|
||||
gobjc
|
||||
|
||||
# packages for libobjc2 / libdispatch
|
||||
APT_PACKAGES_clang: >-
|
||||
libpthread-workqueue-dev
|
||||
|
||||
jobs:
|
||||
########### Linux ###########
|
||||
linux:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ubuntu-latest
|
||||
# don't run pull requests from local branches twice
|
||||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: Ubuntu x64 GCC
|
||||
library-combo: gnu-gnu-gnu
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
|
||||
- name: Ubuntu x64 Clang gnustep-1.9
|
||||
library-combo: ng-gnu-gnu
|
||||
runtime-version: gnustep-1.9
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
|
||||
- name: Ubuntu x64 Clang gnustep-2.0
|
||||
library-combo: ng-gnu-gnu
|
||||
runtime-version: gnustep-2.0
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
|
||||
env:
|
||||
SRC_PATH: ${{ github.workspace }}/source
|
||||
DEPS_PATH: ${{ github.workspace }}/dependencies
|
||||
INSTALL_PATH: ${{ github.workspace }}/build
|
||||
CC: ${{ matrix.CC }}
|
||||
CXX: ${{ matrix.CXX }}
|
||||
LIBRARY_COMBO: ${{ matrix.library-combo }}
|
||||
RUNTIME_VERSION: ${{ matrix.runtime-version }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ env.SRC_PATH }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: ${{ env.SRC_PATH }}
|
||||
|
||||
- name: Install packages
|
||||
run: |
|
||||
sudo apt-get -q -y update
|
||||
sudo apt-get -q -y install $APT_PACKAGES $APT_PACKAGES_${{ matrix.library-combo == 'ng-gnu-gnu' && 'clang' || 'gcc' }}
|
||||
|
||||
# gnustep-2.0 runtime requires ld.gold or lld
|
||||
if [ "$RUNTIME_VERSION" = "gnustep-2.0" ]; then
|
||||
sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 10
|
||||
fi
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
TOOLS_MAKE_BRANCH: ${{github.event.inputs.tools_make_branch}}
|
||||
LIBS_BASE_BRANCH: ${{github.event.inputs.libs_base_branch}}
|
||||
LIBS_GUI_BRANCH: ${{github.event.inputs.libs_gui_branch}}
|
||||
run: ./.github/scripts/dependencies.sh
|
||||
|
||||
- name: Build source for Gorm
|
||||
run: . $INSTALL_PATH/share/GNUstep/Makefiles/GNUstep.sh && make && make install
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
. $INSTALL_PATH/share/GNUstep/Makefiles/GNUstep.sh
|
||||
make check
|
||||
|
||||
- name: Upload logs
|
||||
uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: Logs - ${{ matrix.name }}
|
||||
path: |
|
||||
${{ env.SRC_PATH }}/config.log
|
||||
${{ env.SRC_PATH }}/Tests/tests.log
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -3,5 +3,7 @@
|
|||
*.profile
|
||||
*.palette
|
||||
*.plugin
|
||||
.gdbinit
|
||||
obj
|
||||
InterfaceBuilder
|
||||
derived_src
|
||||
*.framework
|
||||
|
|
22
Applications/GNUmakefile
Normal file
22
Applications/GNUmakefile
Normal file
|
@ -0,0 +1,22 @@
|
|||
#
|
||||
# GNUmakefile - Generated by ProjectCenter
|
||||
#
|
||||
ifeq ($(GNUSTEP_MAKEFILES),)
|
||||
GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null)
|
||||
endif
|
||||
ifeq ($(GNUSTEP_MAKEFILES),)
|
||||
$(error You need to set GNUSTEP_MAKEFILES before compiling!)
|
||||
endif
|
||||
|
||||
include $(GNUSTEP_MAKEFILES)/common.make
|
||||
|
||||
# Generator bundles
|
||||
SUBPROJECTS = \
|
||||
Gorm
|
||||
|
||||
#
|
||||
# Makefiles
|
||||
#
|
||||
-include GNUmakefile.preamble
|
||||
include $(GNUSTEP_MAKEFILES)/aggregate.make
|
||||
-include GNUmakefile.postamble
|
128
Applications/Gorm/English.lproj/Gorm.gorm/data.classes
Normal file
128
Applications/Gorm/English.lproj/Gorm.gorm/data.classes
Normal file
|
@ -0,0 +1,128 @@
|
|||
{
|
||||
"## Comment" = "Do NOT change this file, Gorm maintains it";
|
||||
FirstResponder = {
|
||||
Actions = (
|
||||
"addAttributeToClass:",
|
||||
"alignSelectedObjects:",
|
||||
"arrangeSelectedObjects:",
|
||||
"createClassFiles:",
|
||||
"createSubclass:",
|
||||
"endTesting:",
|
||||
"exportStrings:",
|
||||
"exportXLIFFDocument:",
|
||||
"groupSelectionInBox:",
|
||||
"groupSelectionInMatrix:",
|
||||
"groupSelectionInScrollView:",
|
||||
"groupSelectionInSplitView:",
|
||||
"groupSelectionInView:",
|
||||
"guideline:",
|
||||
"importXLIFFDocument:",
|
||||
"inspector:",
|
||||
"instantiateClass:",
|
||||
"loadClass:",
|
||||
"loadImage:",
|
||||
"loadPalette:",
|
||||
"loadSound:",
|
||||
"newAction:",
|
||||
"orderFrontFontPanel:",
|
||||
"palettes:",
|
||||
"preferencesPanel:",
|
||||
"remove:",
|
||||
"selectAllItems:",
|
||||
"setName:",
|
||||
"testinterface:",
|
||||
"translate:",
|
||||
"ungroup:"
|
||||
);
|
||||
Super = NSObject;
|
||||
};
|
||||
Gorm = {
|
||||
Actions = (
|
||||
"editClass:",
|
||||
"createSubclass:",
|
||||
"testInterface:",
|
||||
"setName:",
|
||||
"selectAllItems:",
|
||||
"paste:",
|
||||
"palettes:",
|
||||
"loadSound:",
|
||||
"loadPalette:",
|
||||
"inspector:",
|
||||
"infoPanel:",
|
||||
"endTesting:",
|
||||
"delete:",
|
||||
"cut:",
|
||||
"copy:",
|
||||
"close:",
|
||||
"miniaturize:",
|
||||
"debug:",
|
||||
"loadImage:",
|
||||
"orderFrontFontPanel:",
|
||||
"ungroup:",
|
||||
"groupSelectionInScrollView:",
|
||||
"groupSelectionInBox:",
|
||||
"groupSelectionInSplitView:",
|
||||
"remove:",
|
||||
"addAttributeToClass:",
|
||||
"instantiateClass:",
|
||||
"createClassFiles:",
|
||||
"loadClass:",
|
||||
"preferencesPanel:",
|
||||
"guideline:",
|
||||
"print:",
|
||||
"groupSelectionInView:",
|
||||
"groupSelectionInMatrix:"
|
||||
);
|
||||
Outlets = (
|
||||
gormMenu,
|
||||
guideLineMenuItem
|
||||
);
|
||||
Super = NSApplication;
|
||||
};
|
||||
GormAppDelegate = {
|
||||
Actions = (
|
||||
"copy:",
|
||||
"cut:",
|
||||
"delete:",
|
||||
"endTesting:",
|
||||
"groupSelectionInBox:",
|
||||
"groupSelectionInSplitView:",
|
||||
"inspector:",
|
||||
"loadImage:",
|
||||
"loadSound:",
|
||||
"ungroup:",
|
||||
"palettes:",
|
||||
"paste:",
|
||||
"preferencesPanel:",
|
||||
"selectAllItems:",
|
||||
"setName:",
|
||||
"testinterface:",
|
||||
"loadPalette:",
|
||||
"createClassFiles:",
|
||||
"createSubclass:",
|
||||
"groupSelectionInScrollView:",
|
||||
"groupSelectionInView:",
|
||||
"guideline:",
|
||||
"instantiateClass:",
|
||||
"loadClass:",
|
||||
"addAttributeToClass:",
|
||||
"remove:",
|
||||
"exportXLIFFDocument:",
|
||||
"importXLIFFDocument:",
|
||||
"exportStrings:",
|
||||
"translate:"
|
||||
);
|
||||
Outlets = (
|
||||
gormMenu,
|
||||
guideLineMenuItem
|
||||
);
|
||||
Super = NSObject;
|
||||
};
|
||||
GormDocumentController = {
|
||||
Actions = (
|
||||
);
|
||||
Outlets = (
|
||||
);
|
||||
Super = NSDocumentController;
|
||||
};
|
||||
}
|
Binary file not shown.
BIN
Applications/Gorm/English.lproj/Gorm.gorm/objects.gorm
Normal file
BIN
Applications/Gorm/English.lproj/Gorm.gorm/objects.gorm
Normal file
Binary file not shown.
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"## Comment" = "Do NOT change this file, Gorm maintains it";
|
||||
FirstResponder = {
|
||||
Actions = (
|
||||
"updateTargetLanguage:",
|
||||
"updateSourceLanguage:"
|
||||
);
|
||||
Super = NSObject;
|
||||
};
|
||||
GormLanguageViewController = {
|
||||
Actions = (
|
||||
"updateTargetLanguage:",
|
||||
"updateSourceLanguage:"
|
||||
);
|
||||
Outlets = (
|
||||
targetLanguage,
|
||||
sourceLanguage
|
||||
);
|
||||
Super = NSViewController;
|
||||
};
|
||||
}
|
Binary file not shown.
Binary file not shown.
171
Applications/Gorm/GNUmakefile
Normal file
171
Applications/Gorm/GNUmakefile
Normal file
|
@ -0,0 +1,171 @@
|
|||
# GNUmakefile: main makefile for GNUstep Object Relationship Modeller
|
||||
#
|
||||
# Copyright (C) 1999,2002,2003 Free Software Foundation, Inc.
|
||||
#
|
||||
# Author: Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
# Date: 2003
|
||||
# Author: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
# Date: 1999
|
||||
#
|
||||
# This file is part of GNUstep.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
ifeq ($(GNUSTEP_MAKEFILES),)
|
||||
GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null)
|
||||
ifeq ($(GNUSTEP_MAKEFILES),)
|
||||
$(warning )
|
||||
$(warning Unable to obtain GNUSTEP_MAKEFILES setting from gnustep-config!)
|
||||
$(warning Perhaps gnustep-make is not properly installed,)
|
||||
$(warning so gnustep-config is not in your PATH.)
|
||||
$(warning )
|
||||
$(warning Your PATH is currently $(PATH))
|
||||
$(warning )
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(GNUSTEP_MAKEFILES),)
|
||||
$(error You need to set GNUSTEP_MAKEFILES before compiling!)
|
||||
endif
|
||||
|
||||
PACKAGE_NAME = gorm
|
||||
export PACKAGE_NAME
|
||||
include $(GNUSTEP_MAKEFILES)/common.make
|
||||
|
||||
CVS_MODULE_NAME = gorm
|
||||
SVN_MODULE_NAME = gorm
|
||||
SVN_BASE_URL = svn+ssh://svn.gna.org/svn/gnustep/apps
|
||||
|
||||
|
||||
include ../../Version
|
||||
|
||||
#
|
||||
# Each palette is a subproject
|
||||
#
|
||||
SUBPROJECTS = \
|
||||
Palettes
|
||||
|
||||
#
|
||||
# MAIN APP
|
||||
#
|
||||
APP_NAME = Gorm
|
||||
Gorm_PRINCIPAL_CLASS=Gorm
|
||||
Gorm_APPLICATION_ICON=Gorm.tiff
|
||||
Gorm_RESOURCE_FILES = \
|
||||
GormInfo.plist \
|
||||
Resources/Defaults.plist \
|
||||
Resources/language-codes.plist \
|
||||
Palettes/0Menus/0Menus.palette \
|
||||
Palettes/1Windows/1Windows.palette \
|
||||
Palettes/2Controls/2Controls.palette \
|
||||
Palettes/3Containers/3Containers.palette \
|
||||
Palettes/4Data/4Data.palette \
|
||||
Images/FileIcon_gmodel.tiff \
|
||||
Images/GormEHCoil.tiff \
|
||||
Images/GormEHLine.tiff \
|
||||
Images/GormEVCoil.tiff \
|
||||
Images/GormEVLine.tiff \
|
||||
Images/GormFile.tiff \
|
||||
Images/GormMenu.tiff \
|
||||
Images/GormMHCoil.tiff \
|
||||
Images/GormMHLine.tiff \
|
||||
Images/GormMVCoil.tiff \
|
||||
Images/GormMVLine.tiff \
|
||||
Images/GormNib.tiff \
|
||||
Images/GormPalette.tiff \
|
||||
Images/Gorm.tiff \
|
||||
Images/GormSourceTag.tiff \
|
||||
Images/GormTargetTag.tiff \
|
||||
Images/GormLinkImage.tiff \
|
||||
Images/GormTesting.tiff \
|
||||
Images/Sunday_seurat.tiff \
|
||||
Images/number_formatter.tiff \
|
||||
Images/date_formatter.tiff \
|
||||
Images/iconAbove_nib.tiff \
|
||||
Images/iconBelow_nib.tiff \
|
||||
Images/iconBottomLeft_nib.tiff \
|
||||
Images/iconBottom_nib.tiff \
|
||||
Images/iconBottomRight_nib.tiff \
|
||||
Images/iconCenterLeft_nib.tiff \
|
||||
Images/iconCenter_nib.tiff \
|
||||
Images/iconCenterRight_nib.tiff \
|
||||
Images/iconLeft_nib.tiff \
|
||||
Images/iconOnly_nib.tiff \
|
||||
Images/iconRight_nib.tiff \
|
||||
Images/iconTopLeft_nib.tiff \
|
||||
Images/iconTop_nib.tiff \
|
||||
Images/iconTopRight_nib.tiff \
|
||||
Images/centeralign_nib.tiff \
|
||||
Images/justifyalign_nib.tiff \
|
||||
Images/leftalign_nib.tiff \
|
||||
Images/naturalalign_nib.tiff \
|
||||
Images/rightalign_nib.tiff \
|
||||
Images/bezel_nib.tiff \
|
||||
Images/button_nib.tiff \
|
||||
Images/centeralign_nib.tiff \
|
||||
Images/iconAbove_nib.tiff \
|
||||
Images/iconBelow_nib.tiff \
|
||||
Images/iconBottomLeft_nib.tiff \
|
||||
Images/iconBottom_nib.tiff \
|
||||
Images/iconBottomRight_nib.tiff \
|
||||
Images/iconCenterLeft_nib.tiff \
|
||||
Images/iconCenter_nib.tiff \
|
||||
Images/iconCenterRight_nib.tiff \
|
||||
Images/iconLeft_nib.tiff \
|
||||
Images/iconOnly_nib.tiff \
|
||||
Images/iconRight_nib.tiff \
|
||||
Images/iconTopLeft_nib.tiff \
|
||||
Images/iconTop_nib.tiff \
|
||||
Images/iconTopRight_nib.tiff \
|
||||
Images/justifyalign_nib.tiff \
|
||||
Images/leftalign_nib.tiff \
|
||||
Images/line_nib.tiff \
|
||||
Images/naturalalign_nib.tiff \
|
||||
Images/noBorder_nib.tiff \
|
||||
Images/photoframe_nib.tiff \
|
||||
Images/ridge_nib.tiff \
|
||||
Images/rightalign_nib.tiff \
|
||||
Images/shortbutton_nib.tiff \
|
||||
Images/tabbot_nib.tiff \
|
||||
Images/tabtop_nib.tiff \
|
||||
Images/titleOnly_nib.tiff \
|
||||
Images/LeftArr.tiff \
|
||||
Images/RightArr.tiff \
|
||||
|
||||
Gorm_LOCALIZED_RESOURCE_FILES = \
|
||||
Gorm.gorm \
|
||||
GormLanguageViewController.gorm \
|
||||
Gorm.rtfd
|
||||
|
||||
Gorm_LANGUAGES = \
|
||||
English
|
||||
|
||||
Gorm_HEADERS = \
|
||||
GormAppDelegate.h \
|
||||
GormLanguageViewController.h
|
||||
|
||||
Gorm_OBJC_FILES = \
|
||||
GormAppDelegate.m \
|
||||
GormLanguageViewController.m \
|
||||
main.m
|
||||
|
||||
-include GNUmakefile.preamble
|
||||
-include GNUmakefile.local
|
||||
|
||||
include $(GNUSTEP_MAKEFILES)/aggregate.make
|
||||
include $(GNUSTEP_MAKEFILES)/application.make
|
||||
|
||||
-include GNUmakefile.postamble
|
41
Applications/Gorm/GNUmakefile.postamble
Normal file
41
Applications/Gorm/GNUmakefile.postamble
Normal file
|
@ -0,0 +1,41 @@
|
|||
#
|
||||
# GNUmakefile.postamble
|
||||
#
|
||||
# Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
#
|
||||
# Author: Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
#
|
||||
# This file is part of GNUstep
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library 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
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; see the file COPYING.LIB.
|
||||
# If not, write to the Free Software Foundation,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02111
|
||||
# USA.
|
||||
#
|
||||
|
||||
# Define this variable if not defined for backwards-compatibility as
|
||||
# it is only available in gnustep-make >= 2.0.5
|
||||
ifeq ($(LN_S_RECURSIVE),)
|
||||
LN_S_RECURSIVE = $(LN_S)
|
||||
endif
|
||||
|
||||
before-all::
|
||||
|
||||
after-all::
|
||||
|
||||
after-clean::
|
||||
|
||||
after-distclean::
|
||||
|
||||
after-clean::
|
|
@ -26,18 +26,17 @@
|
|||
# ADDITIONAL_OBJCFLAGS += -Wall -Werror
|
||||
ADDITIONAL_GUI_LIBS += \
|
||||
-lGormCore \
|
||||
-lGorm \
|
||||
-lGormObjCHeaderParser \
|
||||
-lGormPrefs
|
||||
-lInterfaceBuilder \
|
||||
|
||||
ADDITIONAL_INCLUDE_DIRS += \
|
||||
-IInterfaceBuilder \
|
||||
-IGormObjCHeaderParser \
|
||||
-IGormPrefs \
|
||||
-IGormCore
|
||||
-I../../InterfaceBuilder \
|
||||
-I../../GormObjCHeaderParser \
|
||||
-I../../GormCore \
|
||||
-I../.. \
|
||||
-I.
|
||||
|
||||
ADDITIONAL_LIB_DIRS += \
|
||||
-LGormLib/$(GNUSTEP_OBJ_DIR) \
|
||||
-LGormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
|
||||
-LGormPrefs/$(GNUSTEP_OBJ_DIR) \
|
||||
-LGormCore/$(GNUSTEP_OBJ_DIR)
|
||||
-L../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
|
||||
-L../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
|
||||
-L../../GormCore/GormCore.framework \
|
98
Applications/Gorm/GormAppDelegate.h
Normal file
98
Applications/Gorm/GormAppDelegate.h
Normal file
|
@ -0,0 +1,98 @@
|
|||
/* GormAppDelegate.m
|
||||
*
|
||||
* Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
*
|
||||
* Author: Gregory John Casamento <greg.casamento@gmail.com>
|
||||
* Date: 2023
|
||||
*
|
||||
* This file is part of GNUstep.
|
||||
*
|
||||
* 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 3 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#ifndef GormAppDelegate_H_INCLUDE
|
||||
#define GormAppDelegate_H_INCLUDE
|
||||
|
||||
#import <AppKit/NSSavePanel.h>
|
||||
|
||||
#import <GormCore/GormCore.h>
|
||||
#import <GormCore/GormPrefs.h>
|
||||
|
||||
#import <GNUstepBase/GSObjCRuntime.h>
|
||||
|
||||
@class NSDictionary;
|
||||
@class NSImage;
|
||||
@class NSMenu;
|
||||
@class NSMutableArray;
|
||||
@class NSSet;
|
||||
@class GormLanguageViewController;
|
||||
|
||||
@interface GormAppDelegate : GormAbstractDelegate <NSOpenSavePanelDelegate>
|
||||
{
|
||||
@private
|
||||
GormLanguageViewController *_vc;
|
||||
}
|
||||
|
||||
// preferences
|
||||
- (IBAction) preferencesPanel: (id) sender;
|
||||
|
||||
// Cut/Paste operations
|
||||
- (IBAction) copy: (id)sender;
|
||||
- (IBAction) cut: (id)sender;
|
||||
- (IBAction) paste: (id)sender;
|
||||
- (IBAction) delete: (id)sender;
|
||||
- (IBAction) selectAllItems: (id)sender;
|
||||
|
||||
// palettes/inspectors.
|
||||
- (IBAction) inspector: (id) sender;
|
||||
- (IBAction) palettes: (id) sender;
|
||||
- (IBAction) loadPalette: (id) sender;
|
||||
|
||||
// sound & images
|
||||
- (IBAction) loadSound: (id) sender;
|
||||
- (IBAction) loadImage: (id) sender;
|
||||
|
||||
// grouping/layout
|
||||
- (IBAction) groupSelectionInSplitView: (id)sender;
|
||||
- (IBAction) groupSelectionInBox: (id)sender;
|
||||
- (IBAction) groupSelectionInScrollView: (id)sender;
|
||||
- (IBAction) ungroup: (id)sender;
|
||||
|
||||
// Classes actions
|
||||
- (IBAction) createSubclass: (id)sender;
|
||||
- (IBAction) loadClass: (id)sender;
|
||||
- (IBAction) createClassFiles: (id)sender;
|
||||
- (IBAction) instantiateClass: (id)sender;
|
||||
- (IBAction) addAttributeToClass: (id)sender;
|
||||
- (IBAction) remove: (id)sender;
|
||||
|
||||
// Palettes Actions...
|
||||
- (IBAction) inspector: (id) sender;
|
||||
- (IBAction) palettes: (id) sender;
|
||||
- (IBAction) loadPalette: (id) sender;
|
||||
|
||||
// Translation
|
||||
- (IBAction) importXLIFFDocument: (id)sender;
|
||||
- (IBAction) exportXLIFFDocument: (id)sender;
|
||||
- (IBAction) translate: (id)sender;
|
||||
- (IBAction) exportStrings: (id)sender;
|
||||
|
||||
// Print
|
||||
- (IBAction) print: (id)sender;
|
||||
|
||||
@end
|
||||
|
||||
#endif // GormAppDelegate_H_INCLUDE
|
791
Applications/Gorm/GormAppDelegate.m
Normal file
791
Applications/Gorm/GormAppDelegate.m
Normal file
|
@ -0,0 +1,791 @@
|
|||
/* GormAppDelegate.m
|
||||
*
|
||||
* Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
*
|
||||
* Author: Gregory John Casamento <greg.casamento@gmail.com>
|
||||
* Date: 2023
|
||||
*
|
||||
* This file is part of GNUstep.
|
||||
*
|
||||
* 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 3 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSSet.h>
|
||||
|
||||
#import <AppKit/NSImage.h>
|
||||
#import <AppKit/NSMenu.h>
|
||||
|
||||
#import "GormAppDelegate.h"
|
||||
#import "GormLanguageViewController.h"
|
||||
|
||||
@interface GormDocument (Private)
|
||||
|
||||
- (NSMutableArray *) _collectAllObjects;
|
||||
|
||||
@end
|
||||
|
||||
@implementation GormAppDelegate
|
||||
|
||||
// App delegate...
|
||||
- (BOOL)applicationShouldOpenUntitledFile: (NSApplication *)sender
|
||||
{
|
||||
if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) ==
|
||||
NSWindows95InterfaceStyle)
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) applicationOpenUntitledFile: (NSApplication *)sender
|
||||
{
|
||||
GormDocumentController *dc = [GormDocumentController sharedDocumentController];
|
||||
// open a new document and build an application type document by default...
|
||||
[dc newDocument: sender];
|
||||
}
|
||||
|
||||
|
||||
- (void) applicationDidFinishLaunching: (NSNotification *)n
|
||||
{
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
if ( [defaults boolForKey: @"ShowInspectors"] )
|
||||
{
|
||||
[[[self inspectorsManager] panel] makeKeyAndOrderFront: self];
|
||||
}
|
||||
if ( [defaults boolForKey: @"ShowPalettes"] )
|
||||
{
|
||||
[[[self palettesManager] panel] makeKeyAndOrderFront: self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) applicationWillTerminate: (NSNotification *)n
|
||||
{
|
||||
[[NSUserDefaults standardUserDefaults]
|
||||
setBool: [[[self inspectorsManager] panel] isVisible]
|
||||
forKey: @"ShowInspectors"];
|
||||
[[NSUserDefaults standardUserDefaults]
|
||||
setBool: [[[self palettesManager] panel] isVisible]
|
||||
forKey: @"ShowPalettes"];
|
||||
}
|
||||
|
||||
- (BOOL) applicationShouldTerminateAfterLastWindowClosed: (NSApplication *)sender
|
||||
{
|
||||
if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) ==
|
||||
NSWindows95InterfaceStyle)
|
||||
{
|
||||
GormDocumentController *docController;
|
||||
docController = [GormDocumentController sharedDocumentController];
|
||||
|
||||
if ([[docController documents] count] > 0)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
- (BOOL) validateMenuItem: (NSMenuItem*)item
|
||||
{
|
||||
GormDocument *active = (GormDocument*)[self activeDocument];
|
||||
SEL action = [item action];
|
||||
GormClassManager *cm = nil;
|
||||
NSArray *s = nil;
|
||||
|
||||
// if we have an active document...
|
||||
if(active != nil)
|
||||
{
|
||||
cm = [active classManager];
|
||||
s = [_selectionOwner selection];
|
||||
}
|
||||
|
||||
if(sel_isEqual(action, @selector(loadPalette:)))
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
else if (sel_isEqual(action, @selector(close:))
|
||||
|| sel_isEqual(action, @selector(miniaturize:)))
|
||||
{
|
||||
if (active == nil)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
else if (sel_isEqual(action, @selector(testInterface:)))
|
||||
{
|
||||
if (active == nil)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
else if (sel_isEqual(action, @selector(copy:)))
|
||||
{
|
||||
if ([s count] == 0)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
id o = [s objectAtIndex: 0];
|
||||
NSString *n = [active nameForObject: o];
|
||||
if ([n isEqual: @"NSOwner"] || [n isEqual: @"NSFirst"])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
return [_selectionOwner respondsToSelector: @selector(copySelection)];
|
||||
}
|
||||
else if (sel_isEqual(action, @selector(cut:)))
|
||||
{
|
||||
if ([s count] == 0)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
id o = [s objectAtIndex: 0];
|
||||
NSString *n = [active nameForObject: o];
|
||||
if ([n isEqual: @"NSOwner"] || [n isEqual: @"NSFirst"])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
return ([_selectionOwner respondsToSelector: @selector(copySelection)]
|
||||
&& [_selectionOwner respondsToSelector: @selector(deleteSelection)]);
|
||||
}
|
||||
else if (sel_isEqual(action, @selector(delete:)))
|
||||
{
|
||||
if ([s count] == 0)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
id o = [s objectAtIndex: 0];
|
||||
NSString *n = [active nameForObject: o];
|
||||
if ([n isEqual: @"NSOwner"] || [n isEqual: @"NSFirst"])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
return [_selectionOwner respondsToSelector: @selector(deleteSelection)];
|
||||
}
|
||||
else if (sel_isEqual(action, @selector(paste:)))
|
||||
{
|
||||
if ([s count] == 0)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
id o = [s objectAtIndex: 0];
|
||||
NSString *n = [active nameForObject: o];
|
||||
|
||||
if ([n isEqual: @"NSOwner"] || [n isEqual: @"NSFirst"])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
return [_selectionOwner respondsToSelector: @selector(pasteInSelection)];
|
||||
}
|
||||
else if (sel_isEqual(action, @selector(setName:)))
|
||||
{
|
||||
NSString *n;
|
||||
id o;
|
||||
|
||||
if ([s count] == 0)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
if ([s count] > 1)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
o = [s objectAtIndex: 0];
|
||||
n = [active nameForObject: o];
|
||||
|
||||
if ([n isEqual: @"NSOwner"] || [n isEqual: @"NSFirst"]
|
||||
|| [n isEqual: @"NSFont"] || [n isEqual: @"NSMenu"])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
else if(![active isTopLevelObject: o])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
else if(sel_isEqual(action, @selector(createSubclass:)) ||
|
||||
sel_isEqual(action, @selector(loadClass:)) ||
|
||||
sel_isEqual(action, @selector(createClassFiles:)) ||
|
||||
sel_isEqual(action, @selector(instantiateClass:)) ||
|
||||
sel_isEqual(action, @selector(addAttributeToClass:)) ||
|
||||
sel_isEqual(action, @selector(remove:)))
|
||||
{
|
||||
if(active == nil)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
if(![active isEditingClasses])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
if(sel_isEqual(action, @selector(createSubclass:)))
|
||||
{
|
||||
NSArray *s = [_selectionOwner selection];
|
||||
id o = nil;
|
||||
NSString *name = nil;
|
||||
|
||||
if([s count] == 0 || [s count] > 1)
|
||||
return NO;
|
||||
|
||||
o = [s objectAtIndex: 0];
|
||||
name = [o className];
|
||||
|
||||
if([active classIsSelected] == NO)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
if([name isEqual: @"FirstResponder"])
|
||||
return NO;
|
||||
}
|
||||
|
||||
if(sel_isEqual(action, @selector(createClassFiles:)) ||
|
||||
sel_isEqual(action, @selector(remove:)))
|
||||
{
|
||||
id o = nil;
|
||||
NSString *name = nil;
|
||||
|
||||
if ([s count] == 0)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
if ([s count] > 1)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
o = [s objectAtIndex: 0];
|
||||
name = [o className];
|
||||
if(![cm isCustomClass: name])
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
if(sel_isEqual(action, @selector(instantiateClass:)))
|
||||
{
|
||||
id o = nil;
|
||||
NSString *name = nil;
|
||||
|
||||
if ([s count] == 0)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
if ([s count] > 1)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
if([active classIsSelected] == NO)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
o = [s objectAtIndex: 0];
|
||||
name = [o className];
|
||||
if(name != nil)
|
||||
{
|
||||
id cm = [self classManager];
|
||||
return [cm canInstantiateClassNamed: name];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(sel_isEqual(action, @selector(loadSound:)) ||
|
||||
sel_isEqual(action, @selector(loadImage:)) ||
|
||||
sel_isEqual(action, @selector(debug:)))
|
||||
{
|
||||
if(active == nil)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
- (IBAction) stop: (id)sender
|
||||
{
|
||||
if(_isTesting == NO)
|
||||
{
|
||||
// [super stop: sender];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self endTesting: sender];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction) miniaturize: (id)sender
|
||||
{
|
||||
NSWindow *window = [(GormDocument *)[self activeDocument] window];
|
||||
|
||||
[window miniaturize: self];
|
||||
}
|
||||
|
||||
/** Info Menu Actions */
|
||||
- (IBAction) preferencesPanel: (id) sender
|
||||
{
|
||||
if(! _preferencesController)
|
||||
{
|
||||
_preferencesController = [[GormPrefController alloc] init];
|
||||
}
|
||||
|
||||
[[_preferencesController panel] makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
/** Document Menu Actions */
|
||||
- (IBAction) close: (id)sender
|
||||
{
|
||||
GormDocument *document = (GormDocument *)[self activeDocument];
|
||||
if([document canCloseDocument])
|
||||
{
|
||||
[document close];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction) debug: (id) sender
|
||||
{
|
||||
[[self activeDocument] performSelector: @selector(printAllEditors)];
|
||||
}
|
||||
|
||||
- (IBAction) loadSound: (id) sender
|
||||
{
|
||||
[(GormDocument *)[self activeDocument] openSound: sender];
|
||||
}
|
||||
|
||||
- (IBAction) loadImage: (id) sender
|
||||
{
|
||||
[(GormDocument *)[self activeDocument] openImage: sender];
|
||||
}
|
||||
|
||||
|
||||
/** Edit Menu Actions */
|
||||
|
||||
- (IBAction) copy: (id)sender
|
||||
{
|
||||
if ([[_selectionOwner selection] count] == 0
|
||||
|| [_selectionOwner respondsToSelector: @selector(copySelection)] == NO)
|
||||
return;
|
||||
|
||||
if([self isConnecting])
|
||||
{
|
||||
[self stopConnecting];
|
||||
}
|
||||
|
||||
[(id<IBSelectionOwners,IBEditors>)_selectionOwner copySelection];
|
||||
}
|
||||
|
||||
|
||||
- (IBAction) cut: (id)sender
|
||||
{
|
||||
if ([[_selectionOwner selection] count] == 0
|
||||
|| [_selectionOwner respondsToSelector: @selector(copySelection)] == NO
|
||||
|| [_selectionOwner respondsToSelector: @selector(deleteSelection)] == NO)
|
||||
return;
|
||||
|
||||
if([self isConnecting])
|
||||
{
|
||||
[self stopConnecting];
|
||||
}
|
||||
|
||||
[(id<IBSelectionOwners,IBEditors>)_selectionOwner copySelection];
|
||||
[(id<IBSelectionOwners,IBEditors>)_selectionOwner deleteSelection];
|
||||
}
|
||||
|
||||
- (IBAction) paste: (id)sender
|
||||
{
|
||||
if ([_selectionOwner respondsToSelector: @selector(pasteInSelection)] == NO)
|
||||
return;
|
||||
|
||||
if([self isConnecting])
|
||||
{
|
||||
[self stopConnecting];
|
||||
}
|
||||
|
||||
[(id<IBSelectionOwners,IBEditors>)_selectionOwner pasteInSelection];
|
||||
}
|
||||
|
||||
|
||||
- (IBAction) delete: (id)sender
|
||||
{
|
||||
if ([[_selectionOwner selection] count] == 0
|
||||
|| [_selectionOwner respondsToSelector: @selector(deleteSelection)] == NO)
|
||||
return;
|
||||
|
||||
if([self isConnecting])
|
||||
{
|
||||
[self stopConnecting];
|
||||
}
|
||||
|
||||
[(id<IBSelectionOwners,IBEditors>)_selectionOwner deleteSelection];
|
||||
}
|
||||
|
||||
- (IBAction) selectAll: (id)sender
|
||||
{
|
||||
if ([[_selectionOwner selection] count] == 0
|
||||
|| [_selectionOwner respondsToSelector: @selector(deleteSelection)] == NO)
|
||||
return;
|
||||
|
||||
if([self isConnecting])
|
||||
{
|
||||
[self stopConnecting];
|
||||
}
|
||||
|
||||
[(id<IBSelectionOwners,IBEditors>)_selectionOwner deleteSelection];
|
||||
}
|
||||
|
||||
- (IBAction) selectAllItems: (id)sender
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/** Grouping */
|
||||
|
||||
- (IBAction) groupSelectionInSplitView: (id)sender
|
||||
{
|
||||
if ([[_selectionOwner selection] count] < 2
|
||||
|| [_selectionOwner respondsToSelector: @selector(groupSelectionInSplitView)] == NO)
|
||||
return;
|
||||
|
||||
[(GormGenericEditor *)_selectionOwner groupSelectionInSplitView];
|
||||
}
|
||||
|
||||
- (IBAction) groupSelectionInBox: (id)sender
|
||||
{
|
||||
if ([_selectionOwner respondsToSelector: @selector(groupSelectionInBox)] == NO)
|
||||
return;
|
||||
[(GormGenericEditor *)_selectionOwner groupSelectionInBox];
|
||||
}
|
||||
|
||||
- (IBAction) groupSelectionInView: (id)sender
|
||||
{
|
||||
if ([_selectionOwner respondsToSelector: @selector(groupSelectionInView)] == NO)
|
||||
return;
|
||||
[(GormGenericEditor *)_selectionOwner groupSelectionInView];
|
||||
}
|
||||
|
||||
- (IBAction) groupSelectionInScrollView: (id)sender
|
||||
{
|
||||
if ([_selectionOwner respondsToSelector: @selector(groupSelectionInScrollView)] == NO)
|
||||
return;
|
||||
[(GormGenericEditor *)_selectionOwner groupSelectionInScrollView];
|
||||
}
|
||||
|
||||
- (IBAction) groupSelectionInMatrix: (id)sender
|
||||
{
|
||||
if ([_selectionOwner respondsToSelector: @selector(groupSelectionInMatrix)] == NO)
|
||||
return;
|
||||
[(GormGenericEditor *)_selectionOwner groupSelectionInMatrix];
|
||||
}
|
||||
|
||||
- (IBAction) ungroup: (id)sender
|
||||
{
|
||||
// NSLog(@"ungroup: _selectionOwner %@", _selectionOwner);
|
||||
if ([_selectionOwner respondsToSelector: @selector(ungroup)] == NO)
|
||||
return;
|
||||
[(GormGenericEditor *)_selectionOwner ungroup];
|
||||
}
|
||||
|
||||
/** Classes actions */
|
||||
|
||||
- (IBAction) createSubclass: (id)sender
|
||||
{
|
||||
[(GormDocument *)[self activeDocument] createSubclass: sender];
|
||||
}
|
||||
|
||||
- (IBAction) loadClass: (id)sender
|
||||
{
|
||||
// Call the current document and create the class
|
||||
// descibed by the header
|
||||
[(GormDocument *)[self activeDocument] loadClass: sender];
|
||||
}
|
||||
|
||||
- (IBAction) createClassFiles: (id)sender
|
||||
{
|
||||
[(GormDocument *)[self activeDocument] createClassFiles: sender];
|
||||
}
|
||||
|
||||
- (IBAction) instantiateClass: (id)sender
|
||||
{
|
||||
[(GormDocument *)[self activeDocument] instantiateClass: sender];
|
||||
}
|
||||
|
||||
- (IBAction) addAttributeToClass: (id)sender
|
||||
{
|
||||
[(GormDocument *)[self activeDocument] addAttributeToClass: sender];
|
||||
}
|
||||
|
||||
- (IBAction) remove: (id)sender
|
||||
{
|
||||
[(GormDocument *)[self activeDocument] remove: sender];
|
||||
}
|
||||
|
||||
/** Palettes Actions... */
|
||||
|
||||
- (IBAction) inspector: (id) sender
|
||||
{
|
||||
[[[self inspectorsManager] panel] makeKeyAndOrderFront: self];
|
||||
}
|
||||
|
||||
- (IBAction) palettes: (id) sender
|
||||
{
|
||||
[[[self palettesManager] panel] makeKeyAndOrderFront: self];
|
||||
}
|
||||
|
||||
- (IBAction) loadPalette: (id) sender
|
||||
{
|
||||
[[self palettesManager] openPalette: sender];
|
||||
}
|
||||
|
||||
// Translation
|
||||
- (IBAction) importXLIFFDocument: (id)sender
|
||||
{
|
||||
NSArray *fileTypes = [NSArray arrayWithObjects: @"xliff", nil];
|
||||
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
|
||||
int result;
|
||||
|
||||
[oPanel setAllowsMultipleSelection: NO];
|
||||
[oPanel setCanChooseFiles: YES];
|
||||
[oPanel setCanChooseDirectories: NO];
|
||||
result = [oPanel runModalForDirectory: nil
|
||||
file: nil
|
||||
types: fileTypes];
|
||||
if (result == NSOKButton)
|
||||
{
|
||||
GormDocument *doc = (GormDocument *)[self activeDocument];
|
||||
NSMutableArray *allObjects = [doc _collectAllObjects];
|
||||
NSString *filename = [oPanel filename];
|
||||
NSEnumerator *en = nil;
|
||||
id obj = nil;
|
||||
BOOL result = NO;
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
GormXLIFFDocument *xd = [GormXLIFFDocument xliffWithGormDocument: doc];
|
||||
result = [xd importXLIFFDocumentWithName: filename];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSString *message = [localException reason];
|
||||
NSRunAlertPanel(_(@"Problem loading XLIFF"),
|
||||
message, nil, nil, nil);
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
|
||||
// If actual translation was done, then refresh the objects...
|
||||
if (result == YES)
|
||||
{
|
||||
[doc touch]; // mark the document as modified...
|
||||
|
||||
// change to translated values.
|
||||
en = [allObjects objectEnumerator];
|
||||
while((obj = [en nextObject]) != nil)
|
||||
{
|
||||
if([obj isKindOfClass: [NSView class]])
|
||||
{
|
||||
[obj setNeedsDisplay: YES];
|
||||
}
|
||||
|
||||
// redisplay/flush, if the object is a window.
|
||||
if([obj isKindOfClass: [NSWindow class]])
|
||||
{
|
||||
NSWindow *w = (NSWindow *)obj;
|
||||
[w setViewsNeedDisplay: YES];
|
||||
[w disableFlushWindow];
|
||||
[[w contentView] setNeedsDisplay: YES];
|
||||
[[w contentView] displayIfNeeded];
|
||||
[w enableFlushWindow];
|
||||
[w flushWindowIfNeeded];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction) exportXLIFFDocument: (id)sender
|
||||
{
|
||||
NSSavePanel *savePanel = [NSSavePanel savePanel];
|
||||
NSBundle *bundle = [NSBundle bundleForClass: [GormLanguageViewController class]];
|
||||
NSModalResponse result = 0;
|
||||
GormDocument *doc = (GormDocument *)[self activeDocument];
|
||||
|
||||
if (doc != nil)
|
||||
{
|
||||
NSString *fn = [[doc fileURL] path];
|
||||
|
||||
fn = [[fn lastPathComponent] stringByDeletingPathExtension];
|
||||
fn = [fn stringByAppendingPathExtension: @"xliff"];
|
||||
_vc = [[GormLanguageViewController alloc]
|
||||
initWithNibName: @"GormLanguageViewController"
|
||||
bundle: bundle];
|
||||
|
||||
|
||||
NSDebugLog(@"view = %@, _vc = %@", [_vc view], _vc);
|
||||
|
||||
[savePanel setTitle: @"Export XLIFF"];
|
||||
[savePanel setAccessoryView: [_vc view]];
|
||||
[savePanel setDelegate: self];
|
||||
// [savePanel setURL: [NSURL fileURLWithPath: fn]];
|
||||
|
||||
result = [savePanel runModalForDirectory: nil
|
||||
file: fn];
|
||||
if (NSModalResponseOK == result)
|
||||
{
|
||||
NSString *filename = [[savePanel URL] path];
|
||||
GormXLIFFDocument *xd = [GormXLIFFDocument xliffWithGormDocument: doc];
|
||||
|
||||
[xd exportXLIFFDocumentWithName: filename
|
||||
withSourceLanguage: [_vc sourceLanguageIdentifier]
|
||||
andTargetLanguage: [_vc targetLanguageIdentifier]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *) panel: (id)sender
|
||||
userEnteredFilename: (NSString *)filename
|
||||
confirmed: (BOOL)flag
|
||||
{
|
||||
if (flag == YES)
|
||||
{
|
||||
NSDebugLog(@"Writing the document... %@", filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
NSDebugLog(@"%@ not saved", filename);
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to translate all of the strings in the file from one language
|
||||
* into another. This is helpful when attempting to translate an application for use
|
||||
* in different locales.
|
||||
*/
|
||||
- (IBAction) translate: (id)sender
|
||||
{
|
||||
NSArray *fileTypes = [NSArray arrayWithObjects: @"strings", nil];
|
||||
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
|
||||
int result;
|
||||
|
||||
[oPanel setAllowsMultipleSelection: NO];
|
||||
[oPanel setCanChooseFiles: YES];
|
||||
[oPanel setCanChooseDirectories: NO];
|
||||
result = [oPanel runModalForDirectory: nil
|
||||
file: nil
|
||||
types: fileTypes];
|
||||
if (result == NSOKButton)
|
||||
{
|
||||
GormDocument *doc = (GormDocument *)[self activeDocument];
|
||||
NSMutableArray *allObjects = [doc _collectAllObjects];
|
||||
NSString *filename = [oPanel filename];
|
||||
NSEnumerator *en = nil;
|
||||
id obj = nil;
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
[doc importStringsFromFile: filename];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSString *message = [localException reason];
|
||||
NSRunAlertPanel(_(@"Problem loading strings"),
|
||||
message, nil, nil, nil);
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
|
||||
[doc touch]; // mark the document as modified...
|
||||
|
||||
// change to translated values.
|
||||
en = [allObjects objectEnumerator];
|
||||
while((obj = [en nextObject]) != nil)
|
||||
{
|
||||
if([obj isKindOfClass: [NSView class]])
|
||||
{
|
||||
[obj setNeedsDisplay: YES];
|
||||
}
|
||||
|
||||
// redisplay/flush, if the object is a window.
|
||||
if([obj isKindOfClass: [NSWindow class]])
|
||||
{
|
||||
NSWindow *w = (NSWindow *)obj;
|
||||
[w setViewsNeedDisplay: YES];
|
||||
[w disableFlushWindow];
|
||||
[[w contentView] setNeedsDisplay: YES];
|
||||
[[w contentView] displayIfNeeded];
|
||||
[w enableFlushWindow];
|
||||
[w flushWindowIfNeeded];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to export all strings in a document to a file for Language
|
||||
* translation. This allows the user to see all of the strings which can be translated
|
||||
* and allows the user to provide a translateion for each of them.
|
||||
*/
|
||||
- (IBAction) exportStrings: (id)sender
|
||||
{
|
||||
NSSavePanel *sp = [NSSavePanel savePanel];
|
||||
int result;
|
||||
|
||||
[sp setRequiredFileType: @"strings"];
|
||||
[sp setTitle: _(@"Save strings file as...")];
|
||||
result = [sp runModalForDirectory: NSHomeDirectory()
|
||||
file: nil];
|
||||
if (result == NSOKButton)
|
||||
{
|
||||
NSString *filename = [sp filename];
|
||||
GormDocument *doc = (GormDocument *)[self activeDocument];
|
||||
|
||||
[doc exportStringsToFile: filename];
|
||||
}
|
||||
}
|
||||
|
||||
// Print
|
||||
- (IBAction) print: (id) sender
|
||||
{
|
||||
[[NSApp keyWindow] print: sender];
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,7 +1,9 @@
|
|||
{
|
||||
NSIcon = "Gorm.tiff";
|
||||
NSMainNibFile = "Gorm.gorm";
|
||||
NSPrincipalClass = "NSApplication";
|
||||
NSRole = "Editor";
|
||||
|
||||
NSTypes = (
|
||||
{
|
||||
NSName = "GSGormFileType";
|
||||
|
@ -22,7 +24,7 @@
|
|||
{
|
||||
NSName = "GSNibFileType";
|
||||
NSHumanReadableName = "Cocoa Nib";
|
||||
NSRole = Viewer;
|
||||
NSRole = Editor;
|
||||
NSDocumentClass = GormDocument;
|
||||
NSUnixExtensions = ( "nib" );
|
||||
NSIcon = "GormNib.tiff";
|
||||
|
@ -38,7 +40,7 @@
|
|||
{
|
||||
NSName = "GSXibFileType";
|
||||
NSHumanReadableName = "Cocoa Xib";
|
||||
NSRole = Viewer;
|
||||
NSRole = Editor;
|
||||
NSDocumentClass = GormDocument;
|
||||
NSUnixExtensions = ( "xib" );
|
||||
NSIcon = "GormNib.tiff";
|
||||
|
@ -48,18 +50,19 @@
|
|||
NSIcon = "GormPalette.tiff";
|
||||
}
|
||||
);
|
||||
|
||||
ApplicationDescription = "[GNUstep | Graphical] Object Relationship Modeller";
|
||||
ApplicationIcon = "Gorm.tiff";
|
||||
ApplicationName = "Gorm";
|
||||
ApplicationRelease = "Gorm 1.3.1 (Release)";
|
||||
ApplicationRelease = "Gorm 1.5.0 (Unreleased)";
|
||||
Authors = ("Gregory John Casamento <greg.casamento@gmail.com>",
|
||||
"Adam Fedor <fedor@gnu.org>",
|
||||
"Richard Frith-Macdonald <rfm@gnu.org>",
|
||||
"Wolfgang Lux <wolfgang.lux@gmail.com>",
|
||||
"Pierre-Yves Rivaille <pyrivail@ens-lyon.fr>",
|
||||
"Sergii Stoian <stoyan255@gmail.com>");
|
||||
Copyright = "Copyright (C) 1999-2022 FSF";
|
||||
Copyright = "Copyright (C) 1999-2023 FSF";
|
||||
CopyrightDescription = "Released under the GNU General Public License 3.0";
|
||||
NSBuildVersion = "1.3.1 Jan 15 2022";
|
||||
NSBuildVersion = "1.5.0";
|
||||
GSDesktopInstallationDomain=SYSTEM;
|
||||
}
|
52
Applications/Gorm/GormLanguageViewController.h
Normal file
52
Applications/Gorm/GormLanguageViewController.h
Normal file
|
@ -0,0 +1,52 @@
|
|||
/* GormLanguageViewController.h
|
||||
*
|
||||
* Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
*
|
||||
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
* Date: 2023
|
||||
*
|
||||
* This file is part of GNUstep.
|
||||
*
|
||||
* 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 3 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#ifndef GormLanguageViewController_H_INCLUDE
|
||||
#define GormLanguageViewController_H_INCLUDE
|
||||
|
||||
#import <AppKit/NSViewController.h>
|
||||
|
||||
@class NSDictionary, NSString;
|
||||
|
||||
@interface GormLanguageViewController : NSViewController
|
||||
{
|
||||
IBOutlet id targetLanguage;
|
||||
IBOutlet id sourceLanguage;
|
||||
|
||||
NSString *sourceLanguageIdentifier;
|
||||
NSString *targetLanguageIdentifier;
|
||||
|
||||
NSDictionary *ldict;
|
||||
}
|
||||
|
||||
- (IBAction) updateTargetLanguage: (id)sender;
|
||||
- (IBAction) updateSourceLanguage: (id)sender;
|
||||
|
||||
- (NSString *) sourceLanguageIdentifier;
|
||||
- (NSString *) targetLanguageIdentifier;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
#endif // GormLanguageViewController_H_INCLUDE
|
119
Applications/Gorm/GormLanguageViewController.m
Normal file
119
Applications/Gorm/GormLanguageViewController.m
Normal file
|
@ -0,0 +1,119 @@
|
|||
/* GormLanguageViewController.m
|
||||
*
|
||||
* Copyright (C) 2023 Free Software Foundation, Inc.
|
||||
*
|
||||
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
* Date: 2023
|
||||
*
|
||||
* This file is part of GNUstep.
|
||||
*
|
||||
* 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 3 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSBundle.h>
|
||||
#import <Foundation/NSLocale.h>
|
||||
|
||||
#import <AppKit/NSPopUpButton.h>
|
||||
|
||||
#import "GormLanguageViewController.h"
|
||||
|
||||
@implementation GormLanguageViewController
|
||||
|
||||
- (void) selectPreferredLanguage
|
||||
{
|
||||
NSString *language = [[NSLocale preferredLanguages] objectAtIndex: 0];
|
||||
NSInteger i = [[ldict allKeys] indexOfObject: language];
|
||||
|
||||
NSDebugLog(@"language = %@", language);
|
||||
|
||||
// Set the default translation to the current language
|
||||
[sourceLanguage selectItemAtIndex: i];
|
||||
[targetLanguage selectItemAtIndex: i];
|
||||
|
||||
// Set them since the above doesn't invoke the method that sets them.
|
||||
[self updateTargetLanguage: self];
|
||||
[self updateSourceLanguage: self];
|
||||
}
|
||||
|
||||
|
||||
- (void) viewDidLoad
|
||||
{
|
||||
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
|
||||
NSString *path = [bundle pathForResource: @"language-codes" ofType: @"plist"];
|
||||
|
||||
[super viewDidLoad];
|
||||
if (path != nil)
|
||||
{
|
||||
[targetLanguage removeAllItems];
|
||||
[sourceLanguage removeAllItems];
|
||||
|
||||
NSDebugLog(@"path = %@", path);
|
||||
|
||||
ldict = [[NSDictionary alloc] initWithContentsOfFile: path];
|
||||
if (ldict != nil)
|
||||
{
|
||||
NSEnumerator *en = [ldict keyEnumerator];
|
||||
id k = nil;
|
||||
|
||||
while ((k = [en nextObject]) != nil)
|
||||
{
|
||||
NSString *v = [ldict objectForKey: k];
|
||||
NSString *itemTitle = [NSString stringWithFormat: @"%@ (%@)", k, v];
|
||||
|
||||
[targetLanguage addItemWithTitle: itemTitle];
|
||||
[sourceLanguage addItemWithTitle: itemTitle];
|
||||
}
|
||||
|
||||
// Select preferred language in pop up...
|
||||
[self selectPreferredLanguage];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Unable to load language codes");
|
||||
}
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(ldict);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (IBAction) updateTargetLanguage: (id)sender
|
||||
{
|
||||
NSInteger i = [targetLanguage indexOfSelectedItem];
|
||||
targetLanguageIdentifier = [[ldict allKeys] objectAtIndex: i];
|
||||
}
|
||||
|
||||
- (IBAction) updateSourceLanguage: (id)sender
|
||||
{
|
||||
NSInteger i = [sourceLanguage indexOfSelectedItem];
|
||||
sourceLanguageIdentifier = [[ldict allKeys] objectAtIndex: i];
|
||||
}
|
||||
|
||||
- (NSString *) sourceLanguageIdentifier
|
||||
{
|
||||
return sourceLanguageIdentifier;
|
||||
}
|
||||
|
||||
- (NSString *) targetLanguageIdentifier
|
||||
{
|
||||
return targetLanguageIdentifier;
|
||||
}
|
||||
|
||||
@end
|
0
Images/FileIcon_gmodel.tiff → Applications/Gorm/Images/FileIcon_gmodel.tiff
Executable file → Normal file
0
Images/FileIcon_gmodel.tiff → Applications/Gorm/Images/FileIcon_gmodel.tiff
Executable file → Normal file
0
Images/GormSourceTag.tiff → Applications/Gorm/Images/GormSourceTag.tiff
Executable file → Normal file
0
Images/GormSourceTag.tiff → Applications/Gorm/Images/GormSourceTag.tiff
Executable file → Normal file
0
Images/GormTargetTag.tiff → Applications/Gorm/Images/GormTargetTag.tiff
Executable file → Normal file
0
Images/GormTargetTag.tiff → Applications/Gorm/Images/GormTargetTag.tiff
Executable file → Normal file
19
Applications/Gorm/Palettes/0Menus/GNUmakefile.preamble
Normal file
19
Applications/Gorm/Palettes/0Menus/GNUmakefile.preamble
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Additional include directories the compiler should search
|
||||
ADDITIONAL_INCLUDE_DIRS += -I../../../..
|
||||
|
||||
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
|
||||
ADDITIONAL_LIB_DIRS += \
|
||||
-L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
|
||||
-L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
|
||||
-L../../../../GormCore/GormCore.framework
|
||||
|
||||
ADDITIONAL_GUI_LIBS += -lInterfaceBuilder -lGormCore
|
||||
endif
|
||||
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
|
||||
ADDITIONAL_LIB_DIRS += \
|
||||
-L../../../../InterfaceBuilder/$(GNUSTEP_OBJ_DIR) \
|
||||
-L../../../../GormObjCHeaderParser/$(GNUSTEP_OBJ_DIR) \
|
||||
-L../../../../GormCore/GormCore.framework
|
||||
|
||||
$(PALETTE_NAME)_LIBRARIES_DEPEND_UPON += -lInterfaceBuilder -lGormCore
|
||||
endif
|
|
@ -79,7 +79,7 @@
|
|||
}
|
||||
else if ( sender == menuType )
|
||||
{
|
||||
GormDocument *doc = (GormDocument *)[(id<IB>)NSApp activeDocument];
|
||||
GormDocument *doc = (GormDocument *)[(id<IB>)[NSApp delegate] activeDocument];
|
||||
int tag = [[menuType selectedCell] tag];
|
||||
|
||||
switch ( tag )
|
||||
|
@ -129,7 +129,7 @@
|
|||
if ( object == nil )
|
||||
return;
|
||||
|
||||
doc = (GormDocument *)[(id<IB>)NSApp activeDocument];
|
||||
doc = (GormDocument *)[(id<IB>)[NSApp delegate] activeDocument];
|
||||
|
||||
[titleText setStringValue: [object title]];
|
||||
[autoenable setState: ([object realAutoenablesItems]?NSOnState:NSOffState)];
|
||||
|
@ -157,7 +157,7 @@
|
|||
/* delegate method used for menu title */
|
||||
- (void)controlTextDidChange:(NSNotification *)aNotification
|
||||
{
|
||||
GormDocument *doc = (GormDocument *)[(id<IB>)NSApp activeDocument];
|
||||
GormDocument *doc = (GormDocument *)[(id<IB>)[NSApp delegate] activeDocument];
|
||||
[object setTitle: [titleText stringValue]];
|
||||
[doc touch];
|
||||
}
|
|
@ -202,11 +202,11 @@
|
|||
[NSArray arrayWithObject: GormLinkPboardType]
|
||||
owner: self];
|
||||
[pb setString: name forType: GormLinkPboardType];
|
||||
[NSApp displayConnectionBetween: item and: nil];
|
||||
[NSApp startConnecting];
|
||||
[[NSApp delegate] displayConnectionBetween: item and: nil];
|
||||
[[NSApp delegate] startConnecting];
|
||||
|
||||
isLinkSource = YES;
|
||||
[self dragImage: [NSApp linkImage]
|
||||
[self dragImage: [[NSApp delegate] linkImage]
|
||||
at: dragPoint
|
||||
offset: NSZeroSize
|
||||
event: theEvent
|
||||
|
@ -415,7 +415,7 @@
|
|||
isClosed = YES;
|
||||
[[NSNotificationCenter defaultCenter] removeObserver: self];
|
||||
|
||||
if ([(id<IB>)NSApp selectionOwner] == self)
|
||||
if ([(id<IB>)[NSApp delegate] selectionOwner] == self)
|
||||
{
|
||||
[document resignSelectionForEditor: self];
|
||||
}
|
||||
|
@ -570,11 +570,11 @@
|
|||
{
|
||||
item = [edited itemAtIndex: pos];
|
||||
}
|
||||
if (item == [NSApp connectSource])
|
||||
if (item == [[NSApp delegate] connectSource])
|
||||
{
|
||||
item = nil;
|
||||
}
|
||||
[NSApp displayConnectionBetween: [NSApp connectSource] and: item];
|
||||
[[NSApp delegate] displayConnectionBetween: [[NSApp delegate] connectSource] and: item];
|
||||
return NSDragOperationLink;
|
||||
}
|
||||
else
|
||||
|
@ -587,7 +587,7 @@
|
|||
{
|
||||
if (dragType == GormLinkPboardType)
|
||||
{
|
||||
[NSApp displayConnectionBetween: [NSApp connectSource]
|
||||
[[NSApp delegate] displayConnectionBetween: [[NSApp delegate] connectSource]
|
||||
and: nil];
|
||||
}
|
||||
}
|
||||
|
@ -833,8 +833,8 @@ void _attachAll(NSMenu *menu, id document)
|
|||
{
|
||||
id item = [edited itemAtIndex: pos];
|
||||
|
||||
[NSApp displayConnectionBetween: [NSApp connectSource] and: item];
|
||||
[NSApp startConnecting];
|
||||
[[NSApp delegate] displayConnectionBetween: [[NSApp delegate] connectSource] and: item];
|
||||
[[NSApp delegate] startConnecting];
|
||||
}
|
||||
}
|
||||
else
|
|
@ -62,7 +62,7 @@
|
|||
|
||||
- (void) setObject: (id)anObject
|
||||
{
|
||||
GormDocument *doc = (GormDocument *)[(id<IB>)NSApp activeDocument];
|
||||
GormDocument *doc = (GormDocument *)[(id<IB>)[NSApp delegate] activeDocument];
|
||||
|
||||
ASSIGN(object, nil); // remove reference to old object...
|
||||
[super setObject: anObject];
|
||||
|
@ -87,7 +87,7 @@
|
|||
- (void) updateMenuType: (id)sender
|
||||
{
|
||||
BOOL flag;
|
||||
GormDocument *doc = (GormDocument *)[(id<IB>)NSApp activeDocument];
|
||||
GormDocument *doc = (GormDocument *)[(id<IB>)[NSApp delegate] activeDocument];
|
||||
|
||||
// look at the values passed back in the matrix.
|
||||
flag = ([[menuType cellAtRow: 0 column: 0] state] == NSOnState) ? YES : NO; // windows menu...
|
||||
|
@ -155,7 +155,7 @@
|
|||
- (void)controlTextDidChange:(NSNotification *)aNotification
|
||||
{
|
||||
id o = [aNotification object];
|
||||
id<IBDocuments> doc = [(id<IB>)NSApp activeDocument];
|
||||
id<IBDocuments> doc = [(id<IB>)[NSApp delegate] activeDocument];
|
||||
|
||||
if (o == titleText)
|
||||
{
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue