mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-13 14:13:02 +00:00
Compare commits
274 commits
projectcen
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
b7fcad40f8 | ||
|
1b7cc44ff1 | ||
|
6c0063600d | ||
|
4405dcc8c4 | ||
|
de5e8f63c5 | ||
|
63af855c24 | ||
|
5964418bb1 | ||
|
ac3fad4b6f | ||
|
05e4b859be | ||
|
f5bdb40882 | ||
|
7ce2cd367a | ||
|
fdebc6367f | ||
|
fc194db093 | ||
|
c37b1dbe05 | ||
|
79150d285b | ||
|
5932086c64 | ||
|
cdfebcedba | ||
|
7f100b4ecd | ||
|
cc48c443fa | ||
|
5244eb1037 | ||
|
aeeaf4c3ab | ||
|
8c3ebba096 | ||
|
beb93d83e3 | ||
|
7e64e50cda | ||
|
2c1c01f807 | ||
|
52539893eb | ||
|
522edc8cf6 | ||
|
0d75eae5d0 | ||
|
d63d77b98e | ||
|
377359a92f | ||
|
cf1b7a3215 | ||
|
c8c3b2fc0e | ||
|
008b192d99 | ||
|
c0f24a756f | ||
|
0b8ae1f554 | ||
|
4216c13cda | ||
|
01a3a61b2e | ||
|
a0856faf21 | ||
|
1749847eac | ||
|
8ab1b66eb5 | ||
|
d6a2ce3650 | ||
|
60db8c598f | ||
|
49a778a8ad | ||
|
ae35ca4c10 | ||
|
61eff93341 | ||
|
5b988495cc | ||
|
aaaea5965b | ||
|
07c911b995 | ||
|
aff171ceff | ||
|
bae62a963b | ||
|
bedce090f9 | ||
|
aa76e6406c | ||
|
b701d1a40b | ||
|
b3fa5f1949 | ||
|
d49d4d6e5f | ||
|
77972b4abb | ||
|
994aff232c | ||
|
0b9e2ddb8d | ||
|
538016b372 | ||
|
82d4d12f82 | ||
|
0bce146347 | ||
|
ffcf6cfff6 | ||
|
c0742c88a3 | ||
|
af4e9fffe4 | ||
|
0f6ce6ba95 | ||
|
aed50386f7 | ||
|
6c59f53df4 | ||
|
7504a154e1 | ||
|
f9633b2db6 | ||
|
18136e7678 | ||
|
f9d8e56a2e | ||
|
736093b0c1 | ||
|
87988f435c | ||
|
56d789e232 | ||
|
991b7fba21 | ||
|
25f423bebd | ||
|
dd9a827b30 | ||
|
56f5d087b9 | ||
|
7dedd5871f | ||
|
7c30ee1f38 | ||
|
b7cfa30f20 | ||
|
f68e83ad6f | ||
|
c567c110a3 | ||
|
725da9e9c8 | ||
|
4d19c42454 | ||
|
822e7f0d3a | ||
|
08cd658b6d | ||
|
b3a968b8a3 | ||
|
dd1c1e75ba | ||
|
ec805871c3 | ||
|
b1533c4a02 | ||
|
81e6f3b82a | ||
|
7adfa56357 | ||
|
67381ab3cc | ||
|
a26fbaa6c1 | ||
|
cd0c4972a3 | ||
|
c0fd3f8df7 | ||
|
8970a0617d | ||
|
079467ccc1 | ||
|
34a07aa4d5 | ||
|
a43aff41cf | ||
|
5aa4b5813c | ||
|
5beb3dfe39 | ||
|
7c741d63e6 | ||
|
b672b3b77c | ||
|
244e03d542 | ||
|
5aed0a18c2 | ||
|
058a60fbf4 | ||
|
08c40f31f3 | ||
|
0375286dcf | ||
|
17b6359ba9 | ||
|
6ab80ec17d | ||
|
5da063f7e7 | ||
|
82c6aa3162 | ||
|
a186488b30 | ||
|
196914ef14 | ||
|
f9ed96a3e4 | ||
|
2ace3c327a | ||
|
a6fc84bc9b | ||
|
78e4f47c8f | ||
|
059e105652 | ||
|
aa2ce8fd73 | ||
|
80d0c2575e | ||
|
209f71d692 | ||
|
6544ff872e | ||
|
59a0afd3df | ||
|
e618c988a4 | ||
|
19d497c4d1 | ||
|
dcc9e0ef14 | ||
|
963700e3d6 | ||
|
b87670431a | ||
|
ad65327732 | ||
|
17182aea86 | ||
|
24ede72e4a | ||
|
263106b117 | ||
|
b5324e9581 | ||
|
76b8316b5c | ||
|
1541788856 | ||
|
eb5837315c | ||
|
c0a820612c | ||
|
445b31db3f | ||
|
3df9137f39 | ||
|
79125b35a8 | ||
|
334bfd1f37 | ||
|
654aca86ef | ||
|
f911af422f | ||
|
acf38c1b62 | ||
|
3b006be691 | ||
|
75785db7e4 | ||
|
8b48d77cbb | ||
|
5d80d86a0c | ||
|
5f360ca78b | ||
|
0cdbc996a9 | ||
|
6c4099258c | ||
|
97aa34218f | ||
|
0f8d024577 | ||
|
bf394dce9c | ||
|
b4a148712e | ||
|
5792e6dbfc | ||
|
d894b87557 | ||
|
f1db0b7265 | ||
|
af6ec6a874 | ||
|
478033988a | ||
|
340d101ffd | ||
|
6e70451153 | ||
|
19997eb5c1 | ||
|
b9df6e5d27 | ||
|
3edc315827 | ||
|
eab302cc30 | ||
|
b7fc2a0ccf | ||
|
db013f327c | ||
|
98d05ffe44 | ||
|
4e2edf5d4f | ||
|
4228651008 | ||
|
6139623d1e | ||
|
93a9d4bb47 | ||
|
dab7063bc1 | ||
|
0e1fad82d3 | ||
|
78c6f1622a | ||
|
2dff311c2a | ||
|
f06ea6a5b6 | ||
|
9e127b1771 | ||
|
196afa593c | ||
|
58ced060bf | ||
|
bd2c3557bc | ||
|
3c0c85f3a5 | ||
|
27f8ec6f47 | ||
|
f2a5703959 | ||
|
2a05234abb | ||
|
486dfc7197 | ||
|
684a1b9836 | ||
|
be30cbfa45 | ||
|
7bb6b0a2cc | ||
|
21907bf78c | ||
|
71a0c53576 | ||
|
13412a4318 | ||
|
21ddb6e18a | ||
|
18d31ca7ee | ||
|
55b4d1a424 | ||
|
1ab5955e3d | ||
|
9396623f6f | ||
|
18d49572ee | ||
|
1efa2a8783 | ||
|
94cdea40d3 | ||
|
ce45c22ac0 | ||
|
f1f0317cce | ||
|
cc279c49d0 | ||
|
bc6d46ce5d | ||
|
20aaffe6bd | ||
|
9d1a01891c | ||
|
0bc7e0d6b1 | ||
|
98712ea405 | ||
|
ffe529218b | ||
|
34c9eb4279 | ||
|
b531ee6acb | ||
|
d8e498111e | ||
|
be6efbe7ba | ||
|
715c206bab | ||
|
d32078bd43 | ||
|
4e43654f0a | ||
|
fc3846ac2f | ||
|
12c4b63b33 | ||
|
e082b8e3d7 | ||
|
d1a269c0cb | ||
|
b964564325 | ||
|
233b83b218 | ||
|
4e885f7c5c | ||
|
372a9c4b82 | ||
|
e0617baf52 | ||
|
4998c77d29 | ||
|
dcacd40e33 | ||
|
da18e28fbf | ||
|
950ad36c3a | ||
|
e28350370e | ||
|
75af5d310e | ||
|
35f05690ed | ||
|
17c636f2f7 | ||
|
bd84b332de | ||
|
711ddd72ab | ||
|
f46b6e594a | ||
|
94538f96d0 | ||
|
15b5d6052c | ||
|
1a519dc39d | ||
|
fcd0c869e2 | ||
|
9fb7764ebc | ||
|
fdae99568e | ||
|
635a857419 | ||
|
ebe3320d03 | ||
|
5abf1258c2 | ||
|
6f7585f7a4 | ||
|
be1775dc44 | ||
|
03d439d49c | ||
|
7c4cd31b73 | ||
|
1806cf14dc | ||
|
da0b2d8249 | ||
|
ea33c39542 | ||
|
56f365b1a0 | ||
|
cb8e9ca4d7 | ||
|
2bb51c8462 | ||
|
e287500b99 | ||
|
e60d0be099 | ||
|
b5e637be5f | ||
|
0087c6cd17 | ||
|
ae829b3ac0 | ||
|
35b76bb231 | ||
|
a180a70e83 | ||
|
5c25a46af2 | ||
|
4111197fd7 | ||
|
f4110f9817 | ||
|
6ff7f19613 | ||
|
8b3327c10b | ||
|
cfebdb4e0d | ||
|
37fbd2d382 | ||
|
c900c7c4ce |
169 changed files with 3833 additions and 2041 deletions
23
.github/scripts/build.sh
vendored
Executable file
23
.github/scripts/build.sh
vendored
Executable file
|
@ -0,0 +1,23 @@
|
|||
#! /usr/bin/env sh
|
||||
|
||||
set -ex
|
||||
|
||||
echo "Building..."
|
||||
|
||||
# build dependencies...
|
||||
./.github/scripts/dependencies.sh
|
||||
|
||||
export LIBRARY_PATH=$HOME/staging/lib:$HOME/staging/lib64:$LIBRARY_PATH;
|
||||
export LD_LIBRARY_PATH=$HOME/staging/lib:$HOME/staging/lib64:$LD_LIBRARY_PATH;
|
||||
if [ $LIBRARY_COMBO = 'ng-gnu-gnu' ];
|
||||
then
|
||||
export CPATH=$HOME/staging/include;
|
||||
else
|
||||
export CPATH=/usr/lib/gcc/x86_64-linux-gnu/4.8/include;
|
||||
fi;
|
||||
export PATH=$HOME/staging/bin:$PATH;
|
||||
export GNUSTEP_MAKEFILES=$HOME/staging/share/GNUstep/Makefiles;
|
||||
. $HOME/staging/share/GNUstep/Makefiles/GNUstep.sh;
|
||||
|
||||
# Build gorm
|
||||
make && make install && make check || (cat Tests/tests.log && false);
|
135
.github/scripts/dependencies.sh
vendored
Executable file
135
.github/scripts/dependencies.sh
vendored
Executable file
|
@ -0,0 +1,135 @@
|
|||
#! /usr/bin/env sh
|
||||
|
||||
set -ex
|
||||
|
||||
DEP_SRC=$HOME/dependency_source/
|
||||
DEP_ROOT=$HOME/staging
|
||||
|
||||
install_prerequisites() {
|
||||
sudo apt-get -qq update
|
||||
sudo apt-get install -y cmake pkg-config libgnutls28-dev libgmp-dev libffi-dev libicu-dev \
|
||||
libxml2-dev libxslt1-dev libssl-dev libavahi-client-dev zlib1g-dev
|
||||
|
||||
if [ $LIBRARY_COMBO = 'gnu-gnu-gnu' ];
|
||||
then
|
||||
if [ $CC = 'gcc' ];
|
||||
then
|
||||
sudo apt-get install -y gobjc;
|
||||
fi;
|
||||
sudo apt-get install -y libobjc-8-dev libblocksruntime-dev;
|
||||
else
|
||||
curl -s -o - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -;
|
||||
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main" && sudo apt-get update -qq;
|
||||
sudo apt-get install -y clang-9 libkqueue-dev libpthread-workqueue-dev;
|
||||
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 10 \
|
||||
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-9;
|
||||
export PATH=$(echo "$PATH" | sed -e 's/:\/usr\/local\/clang-7.0.0\/bin//');
|
||||
if [ "$RUNTIME_VERSION" = "gnustep-2.0" ];
|
||||
then
|
||||
sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 10;
|
||||
fi;
|
||||
fi;
|
||||
if [ $LIBRARY_COMBO = 'ng-gnu-gnu' ];
|
||||
then
|
||||
curl -LO https://cmake.org/files/v3.15/cmake-3.15.5-Linux-x86_64.tar.gz;
|
||||
tar xf cmake-3.15.5-Linux-x86_64.tar.gz;
|
||||
mv cmake-3.15.5-Linux-x86_64 $HOME/cmake;
|
||||
export PATH=$HOME/cmake/:$HOME/cmake/bin:$PATH
|
||||
fi;
|
||||
}
|
||||
|
||||
install_gnustep_make() {
|
||||
cd $DEP_SRC
|
||||
git clone https://github.com/gnustep/tools-make.git
|
||||
cd tools-make
|
||||
if [ -n "$RUNTIME_VERSION" ]
|
||||
then
|
||||
WITH_RUNTIME_ABI="--with-runtime-abi=${RUNTIME_VERSION}"
|
||||
else
|
||||
WITH_RUNTIME_ABI=""
|
||||
fi
|
||||
./configure --prefix=$DEP_ROOT --with-library-combo=$LIBRARY_COMBO $WITH_RUNTIME_ABI
|
||||
make install
|
||||
echo Objective-C build flags: `$HOME/staging/bin/gnustep-config --objc-flags`
|
||||
}
|
||||
|
||||
install_ng_runtime() {
|
||||
cd $DEP_SRC
|
||||
git clone https://github.com/gnustep/libobjc2.git
|
||||
cd libobjc2
|
||||
git submodule init
|
||||
git submodule sync
|
||||
git submodule update
|
||||
cd ..
|
||||
mkdir libobjc2/build
|
||||
cd libobjc2/build
|
||||
export CC="clang"
|
||||
export CXX="clang++"
|
||||
export CXXFLAGS="-std=c++11"
|
||||
cmake -DTESTS=off -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGNUSTEP_INSTALL_TYPE=NONE -DCMAKE_INSTALL_PREFIX:PATH=$DEP_ROOT ../
|
||||
make install
|
||||
}
|
||||
|
||||
install_libdispatch() {
|
||||
cd $DEP_SRC
|
||||
# will reference upstream after https://github.com/apple/swift-corelibs-libdispatch/pull/534 is merged
|
||||
git clone -b system-blocksruntime https://github.com/ngrewe/swift-corelibs-libdispatch.git
|
||||
mkdir swift-corelibs-libdispatch/build
|
||||
cd swift-corelibs-libdispatch/build
|
||||
export CC="clang"
|
||||
export CXX="clang++"
|
||||
export LIBRARY_PATH=$DEP_ROOT/lib;
|
||||
export LD_LIBRARY_PATH=$DEP_ROOT/lib:$LD_LIBRARY_PATH;
|
||||
export CPATH=$DEP_ROOT/include;
|
||||
cmake -DBUILD_TESTING=off -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH=$HOME/staging -DINSTALL_PRIVATE_HEADERS=1 -DBlocksRuntime_INCLUDE_DIR=$DEP_ROOT/include -DBlocksRuntime_LIBRARIES=$DEP_ROOT/lib/libobjc.so ../
|
||||
make install
|
||||
}
|
||||
|
||||
install_gnustep_base() {
|
||||
export GNUSTEP_MAKEFILES=$HOME/staging/share/GNUstep/Makefiles
|
||||
. $HOME/staging/share/GNUstep/Makefiles/GNUstep.sh
|
||||
|
||||
cd $DEP_SRC
|
||||
git clone https://github.com/gnustep/libs-base.git
|
||||
cd libs-base
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
}
|
||||
|
||||
install_gnustep_gui() {
|
||||
export GNUSTEP_MAKEFILES=$HOME/staging/share/GNUstep/Makefiles
|
||||
. $HOME/staging/share/GNUstep/Makefiles/GNUstep.sh
|
||||
|
||||
cd $DEP_SRC
|
||||
git clone https://github.com/gnustep/libs-gui.git
|
||||
cd libs-gui
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
}
|
||||
|
||||
install_gnustep_back() {
|
||||
export GNUSTEP_MAKEFILES=$HOME/staging/share/GNUstep/Makefiles
|
||||
. $HOME/staging/share/GNUstep/Makefiles/GNUstep.sh
|
||||
|
||||
cd $DEP_SRC
|
||||
git clone https://github.com/gnustep/libs-back.git
|
||||
cd libs-back
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
}
|
||||
|
||||
mkdir -p $DEP_SRC
|
||||
if [ "$LIBRARY_COMBO" = 'ng-gnu-gnu' ]
|
||||
then
|
||||
install_ng_runtime
|
||||
install_libdispatch
|
||||
fi
|
||||
|
||||
install_prerequisites
|
||||
install_gnustep_make
|
||||
install_gnustep_base
|
||||
install_gnustep_gui
|
||||
install_gnustep_back
|
10
.github/scripts/test.sh
vendored
Executable file
10
.github/scripts/test.sh
vendored
Executable file
|
@ -0,0 +1,10 @@
|
|||
#! /usr/bin/env sh
|
||||
|
||||
set -ex
|
||||
|
||||
echo "Testing..."
|
||||
|
||||
. $HOME/staging/share/GNUstep/Makefiles/GNUstep.sh;
|
||||
|
||||
# Test gorm
|
||||
make check || (cat Tests/tests.log && false);
|
38
.github/workflows/main.yml
vendored
Normal file
38
.github/workflows/main.yml
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: CI
|
||||
|
||||
# Controls when the workflow will run
|
||||
on: push
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run
|
||||
# sequentially or in parallel
|
||||
jobs:
|
||||
# This workflow contains a single job called "build"
|
||||
build:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
LIBRARY_COMBO: gnu-gnu-gnu
|
||||
CC: gcc
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as
|
||||
# part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE,
|
||||
# so your job can access it
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# Runs a single command using the runners shell
|
||||
- name: Build source
|
||||
run: ./.github/scripts/build.sh
|
||||
|
||||
# Runs a single command using the runners shell
|
||||
- name: Run tests
|
||||
run: ./.github/scripts/test.sh
|
||||
|
||||
# Runs a set of commands using the runners shell
|
||||
- name: Run a multi-line script
|
||||
run: |
|
||||
echo Add other actions to build,
|
||||
echo test, and deploy your project.
|
14
.gitignore
vendored
Normal file
14
.gitignore
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
*.app
|
||||
*.debug
|
||||
*.profile
|
||||
*.plugin
|
||||
*.framework
|
||||
*.debugger
|
||||
*.editor
|
||||
*.parser
|
||||
*.preferences
|
||||
*.project
|
||||
*.swp
|
||||
derived_src
|
||||
obj
|
||||
*~
|
6
CODEOWNERS
Normal file
6
CODEOWNERS
Normal file
|
@ -0,0 +1,6 @@
|
|||
# These owners will be the default owners for everything in
|
||||
# the repo. Unless a later match takes precedence,
|
||||
# @global-owner1 and @global-owner2 will be requested for
|
||||
# review when someone opens a pull request.
|
||||
* @rmottola
|
||||
* @gcasa
|
532
ChangeLog
532
ChangeLog
|
@ -1,3 +1,535 @@
|
|||
2022-01-16 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProjectWindow.m
|
||||
nil the delegates of the split-view, avoid a crash on close window.
|
||||
|
||||
2022-01-13 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProjectInspector.m
|
||||
Don't assign nil, it is useless, just destroy it: retaining nil is
|
||||
useless.
|
||||
|
||||
2022-01-12 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditor.h
|
||||
* Modules/Editors/ProjectCenter/PCEditor.m
|
||||
Reduce scope of _extScrollView _intScrollView from ivar to local
|
||||
variables, release after setting to content view and fix
|
||||
double-release of _intScrollView.
|
||||
|
||||
2021-11-30 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.h
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.m
|
||||
Use a timer also for line calculation and status update.
|
||||
|
||||
2021-11-26 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditor.m
|
||||
Do not send double computeNewParenthesisNesting: on key pressed.
|
||||
Furthermore, use a timer so that in case of rapid re-computing
|
||||
it gets invalidated before and only calculated at the last event.
|
||||
|
||||
2021-10-19 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.h
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.m
|
||||
Remove insertText and handle keys through appropriate methods (inserTab, cancelOperation)
|
||||
|
||||
2021-08-18 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditor.m
|
||||
Turn off ligatures, both when setting up the editor as well as when
|
||||
loading a file.
|
||||
|
||||
2021-08-18 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* PCInfoContronoller.m
|
||||
Center info panel correctly the first time on load.
|
||||
|
||||
2021-08-10 Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Framework/PCEditorManager.m: Add method -gotoFile:atLine:
|
||||
* Framework/PCProjectEditor.m: Add method openEditorForFilePath:windowed:
|
||||
* Framework/PCProjectManager.m: Add method openFileAtPath:windowed:
|
||||
* Headers/ProjectCenter/PCEditorManager.h
|
||||
* Headers/ProjectCenter/PCProjectEditor.h
|
||||
* Headers/ProjectCenter/PCProjectManager.h: Declarations for above methods.
|
||||
* Modules/Debuggers/ProjectCenter/GDBWrapper.h
|
||||
* Modules/Debuggers/ProjectCenter/GDBWrapper.m: Add code to pull
|
||||
"thread-selected" dictionary when the debugger stops by using break/pause
|
||||
or by using up or down. Code to syncronize editor with where the debugger
|
||||
has stopped.
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.h
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m: updateEditor method. This
|
||||
method makes use of the gotoFile:atLine: method to get the file and show it
|
||||
in the code editor and go to the line where it has stopped.
|
||||
* Modules/Editors/ProjectCenter/PCEditor.m: Update internal editor
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.m: minor bugfixes.
|
||||
|
||||
2021-07-16 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/GDBWrapper.h
|
||||
* Modules/Debuggers/ProjectCenter/GDBWrapper.m
|
||||
Don't send keystrokes directly to gdb, but accumulate a line until return and send, allows to handle backspaces.
|
||||
|
||||
2021-07-09 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProjectLauncher.m
|
||||
If we already instantiated a Debugger, reuse it.
|
||||
|
||||
2021-07-06 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.h
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m
|
||||
Change parsing of MI interface to a LAR parser and avoid issue
|
||||
of recursive [] {} values in the previous parser.
|
||||
|
||||
2021-06-22 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.h
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m
|
||||
Accessor methods for specific debugger information as wellas filename and line.
|
||||
|
||||
2021-05-13 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Projects/Application/PCAppProject+Inspector.h
|
||||
* Modules/Projects/Application/PCAppProject+Inspector.m
|
||||
* Modules/Projects/Application/PCAppProject.m
|
||||
* Modules/Projects/Application/Resources/Inspector.gorm
|
||||
Fix HelpFile by saving the property in the app project and generating
|
||||
the plist.
|
||||
|
||||
2021-02-19 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditor.h
|
||||
* Modules/Editors/ProjectCenter/PCEditor.m
|
||||
Keep track of the file modification date on each open/save,
|
||||
compare it to the current file to detect external modifications.
|
||||
|
||||
2021-02-12 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCFileManager.m
|
||||
Open in project directory preferentially if no last open
|
||||
dir (quick version, ignores file type).
|
||||
|
||||
2021-02-06 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditor.m
|
||||
Respect background selection preferences and infer text
|
||||
as inverse.
|
||||
|
||||
2021-02-04 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProjectManager.m
|
||||
* PCAppController.m:
|
||||
Cleanup a bit the setting of the active project and the key win.
|
||||
|
||||
2021-02-03 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProjectInspector.m
|
||||
Check for invalid filenames and in case, reset to the original
|
||||
file name.
|
||||
|
||||
2021-02-03 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCEditorManager.m:
|
||||
Do not open an external editor if an in-window is requested.
|
||||
|
||||
2020-09-08 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/SyntaxHighlighter.h
|
||||
* Modules/Editors/ProjectCenter/SyntaxHighlighter.m
|
||||
Add setters for fonts.
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.h
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.m
|
||||
Separate font accessors in to class and instance methods.
|
||||
Do not use preferences in class methods, since they are outside the
|
||||
protocol.
|
||||
|
||||
2020-09-08 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProjectLauncher.m
|
||||
Access Preferences through its protocol, since the launcher is in the
|
||||
Framework.
|
||||
|
||||
2020-04-16 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.m:(drawRect:)
|
||||
Fix range to use characters and not glyphs, sicne highlighting is based on chars.
|
||||
|
||||
2020-03-24 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProjectLauncher.m
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m
|
||||
* Modules/Debuggers/ProjectCenter/PCDebuggerView.h
|
||||
* Modules/Debuggers/ProjectCenter/PCDebuggerViewDelegateProtocol.h
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.h
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.m
|
||||
Uniform font defaults to use PCPreferenceController, fix Debugger to
|
||||
actually make setFont work thorugh the view-delegate chain.
|
||||
|
||||
2020-03-24 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m
|
||||
Fix loading of font from preferences.
|
||||
|
||||
2019-12-29 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Framework/PCButton.m
|
||||
* Framework/PCProjectBrowser.m
|
||||
* Framework/PCProjectLauncherPanel.m
|
||||
* Framework/PCProjectLoadedFilesPanel.m
|
||||
* Framework/PCProjectManager.m
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m
|
||||
* Modules/Editors/ProjectCenter/SyntaxHighlighter.m
|
||||
* Modules/Projects/Library/PCLibProject.h
|
||||
* Modules/Projects/Library/PCLibProject.m
|
||||
Remove compiler warnings.
|
||||
* .gitignore: Add file
|
||||
|
||||
2019-05-25 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/SyntaxDefinition.h
|
||||
* Modules/Editors/ProjectCenter/SyntaxDefinition.m
|
||||
Uniform context type to NSUInteger.
|
||||
|
||||
2019-05-22 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCButton.m
|
||||
* Headers/ProjectCenter/PCButton.h
|
||||
Remove custom ToolTip implementation now present in GUI.
|
||||
|
||||
2018-06-19 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Projects/Framework/PCFrameworkProject.h
|
||||
* Modules/Projects/Framework/PCFrameworkProject.m
|
||||
Add some GSDoc makefile aids
|
||||
|
||||
2017-08-16 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Projects/Application/PCAppProject.m
|
||||
Fix for nil bundle identifier.
|
||||
|
||||
2017-01-17 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProjectManager.m
|
||||
* Modules/Projects/Application/PCAppProject.h
|
||||
Fix wrong declaration and missing subtype option.
|
||||
|
||||
2017-01-13 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProjectManager.m
|
||||
* Headers/Protocols/ProjectType.h
|
||||
* Modules/Projects/Aggregate/PCAggregateProject.h
|
||||
* Modules/Projects/Aggregate/PCAggregateProject.m
|
||||
* Modules/Projects/Application/PCAppProject.h
|
||||
* Modules/Projects/Application/PCAppProject.m
|
||||
* Modules/Projects/Bundle/PCBundleProject.h
|
||||
* Modules/Projects/Bundle/PCBundleProject.m
|
||||
* Modules/Projects/Framework/PCFrameworkProject.h
|
||||
* Modules/Projects/Framework/PCFrameworkProject.m
|
||||
* Modules/Projects/ResourceSet/PCResourceSetProject.h
|
||||
* Modules/Projects/ResourceSet/PCResourceSetProject.m
|
||||
* Modules/Projects/Tool/PCToolProject.h
|
||||
* Modules/Projects/Tool/PCToolProject.m
|
||||
Pass options to createProjectAt and use those to create Gorm/Renaissance subtypes, enable the former by default.
|
||||
|
||||
2016-12-16 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m
|
||||
Conditionally split on windows with CR-LF
|
||||
|
||||
2016-11-28 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Parsers/ProjectCenter/PCParser.m
|
||||
Fix off-by-one in length when checking the last character.
|
||||
|
||||
2016-11-25 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.h
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m
|
||||
skip and report empty lines as PCDBEmptyRecord
|
||||
|
||||
2016-11-19 11:22-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m
|
||||
* Modules/Debuggers/ProjectCenter/PCDebuggerViewDelegateProtocol.h
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m: Added/implemented
|
||||
debuggerSetup method.
|
||||
|
||||
2016-11-18 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Projects/Application/PCAppProject+Inspector.h
|
||||
* Modules/Projects/Application/PCAppProject+Inspector.m
|
||||
* Modules/Projects/Application/Resources/Inspector.gorm
|
||||
Connect add/remove buttons.
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m
|
||||
Commands need new-line.
|
||||
|
||||
2016-11-17 09:20-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m: Change flag to yes
|
||||
in parseLine method to indicate debugger has started.
|
||||
|
||||
2016-11-17 09:18-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.h
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.h
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m: Added notification
|
||||
to fix breakpoint loading.
|
||||
|
||||
2016-09-29 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.h
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m
|
||||
* Modules/Debuggers/ProjectCenter/PCDebuggerViewDelegateProtocol.h
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m
|
||||
Add skeleton to handle breakpoints, add breakpoint types.
|
||||
|
||||
2016-06-06 11:47-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PCDebuggerView.m: Add code to
|
||||
make commands appear when the button is pressed.
|
||||
|
||||
2016-05-22 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.h
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.m
|
||||
Comply to protocol.
|
||||
|
||||
* Modules/Editors/ProjectCenter/SyntaxHighlighter.h
|
||||
* Modules/Editors/ProjectCenter/SyntaxHighlighter.m
|
||||
Transition to NSInteger/NSUInteger
|
||||
|
||||
2016-05-15 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m
|
||||
On windows kill with DebugBreakProcess() and not tskill. Available only on WinXP or higher.
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m
|
||||
For GDB < v. 7 (on win), attempt to grab process id from Windows thread information.
|
||||
|
||||
2016-05-05 15:43-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m: Minor changes.
|
||||
|
||||
2016-05-05 13:13-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m: Partial parsing
|
||||
of result records to yield correct status in debuggerView.
|
||||
|
||||
2016-05-05 11:23-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m: Handle more
|
||||
escaped sequences to futher clean up output.
|
||||
|
||||
2016-05-03 19:40-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.h
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m: Add parsers
|
||||
to handle output from various types of MI data. Code to handle
|
||||
each individual case is being written.
|
||||
|
||||
2016-05-03 18:00-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m
|
||||
* Modules/Debuggers/ProjectCenter/PCDebuggerView.m
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m: Changes
|
||||
to allow pid to be passed back to PCDebugger by calling
|
||||
setSubProcessId once the pid is parsed from the mi output.
|
||||
|
||||
2016-05-03 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.h
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m
|
||||
Refactor path to executablePath.
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m
|
||||
Do not permit deletion beyond the new line or the gdb prompt.
|
||||
|
||||
2016-03-23 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m
|
||||
* Modules/Debuggers/ProjectCenter/PCDebuggerView.h
|
||||
* Modules/Debuggers/ProjectCenter/PCDebuggerView.m
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.h
|
||||
* Modules/Debuggers/ProjectCenter/PipeDelegate.m
|
||||
* Modules/Debuggers/ProjectCenter/PCDebuggerViewDelegateProtocol.h
|
||||
Merge in from pipes branch: stdio/stdout over pipes handled in a separate delegate class.
|
||||
|
||||
2016-03-23 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCBundleManager.m
|
||||
* Framework/PCProjectLauncher.m
|
||||
Merge from branch: check bundle loading and warn.
|
||||
|
||||
2016-03-15 18:47-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PTYView.h
|
||||
* Modules/Debuggers/ProjectCenter/PTYView.m:
|
||||
Undo previous change. Move Riccardo's change to
|
||||
branch ptyview_with_pipes.
|
||||
|
||||
2016-03-14 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PTYView.h
|
||||
* Modules/Debuggers/ProjectCenter/PTYView.m
|
||||
Use stdio/stdout over pipes instead of a tty
|
||||
|
||||
2016-03-08 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProjectLauncher.m
|
||||
Update debug executable path search to run, make it work on windows.
|
||||
|
||||
2015-11-09 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProjectInspector.m
|
||||
Allocate a Mutable Array before assagning an Array to a MutableArray
|
||||
|
||||
2015-11-05 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Projects/Application/PCAppProject+Inspector.h
|
||||
* Modules/Projects/Application/PCAppProject+Inspector.m
|
||||
* Headers/ProjectCenter/PCDefines.h
|
||||
* Modules/Projects/Application/PCAppProject.h
|
||||
* Modules/Projects/Application/PCAppProject.m
|
||||
* Modules/Projects/Application/Resources/Inspector.gorm
|
||||
CFBundleIdentifier support for Apps.
|
||||
|
||||
2015-11-02 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.m
|
||||
Cleanups and NSInteger conversion.
|
||||
|
||||
* Modules/Editors/ProjectCenter/LineJumper.h
|
||||
* Modules/Editors/ProjectCenter/LineJumper.m
|
||||
declare missing method
|
||||
|
||||
2015-06-16 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/GNUmakefile
|
||||
* Framework/PCFileCreator.m
|
||||
* Headers/ProjectCenter/PCFileCreator.h
|
||||
* Framework/Resources/ocppclass.template
|
||||
Enable project addition of obj-c++ classes.
|
||||
|
||||
2015-06-13 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProjectEditor.m
|
||||
Re-enable wrongly uncommented statement.
|
||||
|
||||
* Framework/PCEditorManager.m
|
||||
If we have a directory, we check if it is a bundle that an app can open it and open it through NSWorkspace.
|
||||
|
||||
2015-06-12 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditor.m
|
||||
Enable parsing of obj-c++
|
||||
|
||||
2015-06-12 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/Resources/Info.table
|
||||
Enable Obj-C++ extension.
|
||||
|
||||
* Framework/PCEditorManager.m
|
||||
Use the internal editor if it is available, even if no parser is available.
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditor.m
|
||||
Handle missing image better.
|
||||
|
||||
2015-04-07 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.m
|
||||
Use constants and not strings as keys.
|
||||
|
||||
* Modules/Debuggers/ProjectCenter/PCDebugger.m
|
||||
Use console font for the view.
|
||||
|
||||
2015-03-22 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m
|
||||
Use Preferences color methods.
|
||||
|
||||
2015-03-22 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Headers/Protocols/Preferences.h
|
||||
* PCPrefController.m
|
||||
Direct preferences method for setting and getting colors.
|
||||
|
||||
2015-03-22 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m
|
||||
Convert CMYK to RGB before serializing.
|
||||
|
||||
2015-03-22 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditor.m
|
||||
Actually use the background color preference.
|
||||
|
||||
2015-03-22 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Headers/Protocols/Preferences.h
|
||||
* Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m
|
||||
* PCPrefController.m
|
||||
Move colorFromString from PCEditorFSCPrefs to PCPrefsController and make it thus generally available.
|
||||
|
||||
2015-03-12 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Projects/Framework/PCFrameworkProject.m
|
||||
Generate the PACKAGE_NAME for Frameworks.
|
||||
|
||||
2015-03-11 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m
|
||||
Bug Fix: Set the font manager with the picked font, not always the same.
|
||||
|
||||
2015-03-11 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h
|
||||
* Modules/Preferences/EditorFSC/PCEditorFSCPrefs.m
|
||||
* Modules/Preferences/EditorFSC/Resources/EditorFSCPrefs.gorm
|
||||
Provide Editor and Fixed font preferences, instead of plain and rich.
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.m
|
||||
Use the preferences Editor font instead of the system one.
|
||||
|
||||
2014-12-16 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProject.m
|
||||
Initialize backup wrapper after wrapperPath since it depends on it!
|
||||
|
||||
2014-12-16 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCMakefileFactory.m
|
||||
Generate sections only if there are classes.
|
||||
|
||||
2014-12-15 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCMakefileFactory.m
|
||||
Create mm sections in makefiles for Objective-C++
|
||||
|
||||
2014-12-08 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProject.m
|
||||
Accept also Objective-C++ classes as Class files
|
||||
|
||||
2014-11-20 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Parsers/ProjectCenter/PCParser.m
|
||||
Force last action on parser if file lacks a new line at EOF.
|
||||
|
||||
2014-11-20 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Parsers/ProjectCenter/ObjCCommentHandler.m
|
||||
Fix parser to ignore comments inside strings.
|
||||
|
||||
2014-10-07 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/PCProjectManager.m
|
||||
|
|
|
@ -1,11 +1,19 @@
|
|||
{
|
||||
"## Comment" = "Do NOT change this file, Gorm maintains it";
|
||||
FirstResponder = {
|
||||
Actions = (
|
||||
"showInfoWindow:"
|
||||
);
|
||||
Super = NSObject;
|
||||
};
|
||||
PCInfoController = {
|
||||
Actions = (
|
||||
"showInfoWindow:"
|
||||
);
|
||||
Outlets = (
|
||||
infoWindow,
|
||||
versionField
|
||||
versionField,
|
||||
copyrightField
|
||||
);
|
||||
Super = NSObject;
|
||||
};
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -7,9 +7,9 @@ include $(GNUSTEP_MAKEFILES)/common.make
|
|||
#
|
||||
# Framework
|
||||
#
|
||||
VERSION = 0.6.2
|
||||
VERSION = 0.7.0
|
||||
FRAMEWORK_NAME = ProjectCenter
|
||||
ProjectCenter_CURRENT_VERSION_NAME = 0.6.2
|
||||
ProjectCenter_CURRENT_VERSION_NAME = 0.7.0
|
||||
ProjectCenter_DEPLOY_WITH_CURRENT_VERSION = yes
|
||||
ProjectCenter_HEADER_FILES_DIR = ../Headers/ProjectCenter
|
||||
|
||||
|
@ -104,6 +104,7 @@ ProjectCenter_RESOURCE_FILES = \
|
|||
Resources/header.template \
|
||||
Resources/postamble.template \
|
||||
Resources/protocol.template \
|
||||
Resources/ocppclass.template \
|
||||
|
||||
#
|
||||
# Localization
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
# 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,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 31 Milk Street #960789 Boston, MA 02196 USAA.
|
||||
|
||||
#before-all::
|
||||
# cd ..;rm -f ProjectCenter;$(LN_S) Library ProjectCenter
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
# 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,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 31 Milk Street #960789 Boston, MA 02196 USAA.
|
||||
|
||||
#
|
||||
# Makefile.preamble
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCLogController.h>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCAuxiliaryWindow.h>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
// TODO: Finish support for third party bundles.
|
||||
|
@ -129,6 +129,7 @@
|
|||
reqBundlesInfo = [self infoForBundlesType:extension];
|
||||
enumerator = [[reqBundlesInfo allKeys] objectEnumerator];
|
||||
|
||||
infoTable = nil;
|
||||
while ((bundlePath = [enumerator nextObject]))
|
||||
{
|
||||
infoTable = [reqBundlesInfo objectForKey:bundlePath];
|
||||
|
@ -167,6 +168,7 @@
|
|||
NSString *bundlePath;
|
||||
NSDictionary *infoTable;
|
||||
|
||||
infoTable = nil;
|
||||
while ((bundlePath = [enumerator nextObject]))
|
||||
{
|
||||
infoTable = [reqBundlesInfo objectForKey:bundlePath];
|
||||
|
@ -235,6 +237,7 @@
|
|||
|
||||
if (!className)
|
||||
{
|
||||
NSLog(@"Bundle for class called with empty className");
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2003-2014 Free Software Foundation
|
||||
Copyright (C) 2003-2019 Free Software Foundation
|
||||
|
||||
Authors: Serg Stoyan
|
||||
Riccardo Mottola
|
||||
|
||||
This file is part of GNUstep.
|
||||
This file is part of ProjectCenter.
|
||||
|
||||
This application is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
|
@ -19,15 +20,12 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCButton.h>
|
||||
#import <ProjectCenter/PCDefines.h>
|
||||
|
||||
#import <AppKit/NSBezierPath.h>
|
||||
#import <GNUstepGUI/GSTrackingRect.h>
|
||||
|
||||
@implementation PCButton
|
||||
|
||||
// ============================================================================
|
||||
|
@ -37,346 +35,16 @@
|
|||
- (id)initWithCoder:(NSCoder *)coder
|
||||
{
|
||||
self = [super initWithCoder:coder];
|
||||
[_cell setGradientType:NSGradientConcaveWeak];
|
||||
[_cell setImageDimsWhenDisabled:YES];
|
||||
[self setImagePosition:NSImageOnly];
|
||||
[self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
|
||||
[self setRefusesFirstResponder:YES];
|
||||
|
||||
_hasTooltips = NO;
|
||||
ttTimer = nil;
|
||||
ttWindow = nil;
|
||||
ttTitleAttrs = [[NSMutableDictionary alloc] init];
|
||||
[ttTitleAttrs setObject:[NSFont systemFontOfSize:10.0]
|
||||
forKey:NSFontAttributeName];
|
||||
ttBackground = [NSColor colorWithDeviceRed:1.0 green:1.0 blue:0.90 alpha:1.0];
|
||||
RETAIN(ttBackground);
|
||||
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver:self
|
||||
selector:@selector(_updateTrackingRects:)
|
||||
name:NSViewFrameDidChangeNotification
|
||||
object:[[self window] contentView]];
|
||||
|
||||
if (self)
|
||||
{
|
||||
[_cell setGradientType:NSGradientConcaveWeak];
|
||||
[_cell setImageDimsWhenDisabled:YES];
|
||||
[self setImagePosition:NSImageOnly];
|
||||
[self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
|
||||
[self setRefusesFirstResponder:YES];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
||||
if (_hasTooltips)
|
||||
{
|
||||
[self removeAllToolTips];
|
||||
RELEASE(ttTitleAttrs);
|
||||
RELEASE(ttBackground);
|
||||
RELEASE(ttWindow);
|
||||
}
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (oneway void)release
|
||||
{
|
||||
// If retain count is number of tracking rects + superview retain,
|
||||
// remove tracking rects. It seems that tracking rects retain this object.
|
||||
if (_hasTooltips && [self retainCount] == [_tracking_rects count] + 1)
|
||||
{
|
||||
[self removeAllToolTips];
|
||||
}
|
||||
|
||||
[super release];
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ==== Private methods
|
||||
// ============================================================================
|
||||
|
||||
- (void)_updateTrackingRects:(NSNotification *)aNotif
|
||||
{
|
||||
NSTrackingRectTag tag;
|
||||
NSRect rect;
|
||||
NSString *string = nil;
|
||||
int i, j;
|
||||
GSTrackingRect *tr = nil;
|
||||
|
||||
if (_hasTooltips == NO)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
j = [_tracking_rects count];
|
||||
for (i = 0; i < j; i++)
|
||||
{
|
||||
tr = [_tracking_rects objectAtIndex:i];
|
||||
|
||||
// Save tooltip string for next addTrackingRect::::
|
||||
string = [(NSString *)tr->user_data copy];
|
||||
|
||||
[self removeTrackingRect:tr->tag];
|
||||
|
||||
// NSLog(@"PCButton: tr: %i data: %@", tr->tag, tr->user_data);
|
||||
|
||||
rect = [self frame];
|
||||
rect.origin.x = 0;
|
||||
rect.origin.y = 0;
|
||||
tag = [self addTrackingRect:rect
|
||||
owner:self
|
||||
userData:string
|
||||
assumeInside:NO];
|
||||
|
||||
if (tr->tag == mainToolTip)
|
||||
{
|
||||
mainToolTip = tag;
|
||||
}
|
||||
|
||||
RELEASE(string);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_invalidateTimer
|
||||
{
|
||||
if (ttTimer == nil)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// NSLog(@"_invalidateTimer");
|
||||
if ([ttTimer isValid])
|
||||
{
|
||||
[ttTimer invalidate];
|
||||
}
|
||||
ttTimer = nil;
|
||||
}
|
||||
|
||||
- (void)_closeToolTipWindow
|
||||
{
|
||||
if (ttWindow)
|
||||
{
|
||||
[ttWindow close];
|
||||
ttWindow = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_drawToolTip:(NSAttributedString *)title
|
||||
{
|
||||
NSRectEdge sides[] = {NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge};
|
||||
NSColor *black = [NSColor blackColor];
|
||||
NSColor *colors[] = {black, black, black, black};
|
||||
NSRect bounds = [[ttWindow contentView] bounds];
|
||||
NSRect titleRect;
|
||||
|
||||
titleRect = [ttWindow frame];
|
||||
titleRect.origin.x = 2;
|
||||
titleRect.origin.y = -2;
|
||||
|
||||
[[ttWindow contentView] lockFocus];
|
||||
|
||||
[title drawInRect:titleRect];
|
||||
NSDrawColorTiledRects(bounds, bounds, sides, colors, 4);
|
||||
|
||||
[[ttWindow contentView] unlockFocus];
|
||||
}
|
||||
|
||||
- (void)_showTooltip:(NSTimer *)timer
|
||||
{
|
||||
NSString *ttText = [timer userInfo];
|
||||
|
||||
[self _invalidateTimer];
|
||||
|
||||
// NSLog(@"showTooltip: %@", ttText);
|
||||
// NSLog(@"toolTips: %@", toolTips);
|
||||
|
||||
if (ttWindow == nil)
|
||||
{
|
||||
NSAttributedString *attributedTitle = nil;
|
||||
NSSize titleSize;
|
||||
NSPoint mouseLocation = [NSEvent mouseLocation];
|
||||
NSRect windowRect;
|
||||
|
||||
attributedTitle =
|
||||
[[NSAttributedString alloc] initWithString:ttText
|
||||
attributes:ttTitleAttrs];
|
||||
titleSize = [attributedTitle size];
|
||||
|
||||
// Window
|
||||
windowRect = NSMakeRect(mouseLocation.x + 8,
|
||||
mouseLocation.y - 16 - (titleSize.height+3),
|
||||
titleSize.width + 4, titleSize.height + 4);
|
||||
|
||||
ttWindow = [[NSWindow alloc] initWithContentRect:windowRect
|
||||
styleMask:NSBorderlessWindowMask
|
||||
backing:NSBackingStoreRetained
|
||||
defer:YES];
|
||||
[ttWindow setBackgroundColor:ttBackground];
|
||||
[ttWindow setReleasedWhenClosed:YES];
|
||||
[ttWindow setExcludedFromWindowsMenu:YES];
|
||||
[ttWindow setLevel:NSStatusWindowLevel];
|
||||
|
||||
[ttWindow orderFront:nil];
|
||||
|
||||
[self _drawToolTip:attributedTitle];
|
||||
RELEASE(attributedTitle);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ==== Tool Tips
|
||||
// ============================================================================
|
||||
|
||||
/*- (void)mouseEntered:(NSEvent *)theEvent
|
||||
{
|
||||
NSLog (@"mouseEntered");
|
||||
|
||||
if (ttTimer == nil)
|
||||
{
|
||||
ttTimer = [NSTimer scheduledTimerWithTimeInterval:0.5
|
||||
target:self
|
||||
selector:@selector(_showTooltip:)
|
||||
userInfo:[theEvent userData]
|
||||
repeats:YES];
|
||||
[[self window] setAcceptsMouseMovedEvents:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)mouseExited:(NSEvent *)theEvent
|
||||
{
|
||||
// NSLog (@"mouseExited");
|
||||
[self _invalidateTimer];
|
||||
[self _closeToolTipWindow];
|
||||
[[self window] setAcceptsMouseMovedEvents:NO];
|
||||
}
|
||||
|
||||
- (void)mouseDown:(NSEvent *)theEvent
|
||||
{
|
||||
// NSLog (@"mouseDown");
|
||||
[self _invalidateTimer];
|
||||
[self _closeToolTipWindow];
|
||||
|
||||
[super mouseDown:theEvent];
|
||||
}
|
||||
|
||||
- (void)mouseMoved:(NSEvent *)theEvent
|
||||
{
|
||||
NSPoint mouseLocation;
|
||||
NSPoint origin;
|
||||
|
||||
// NSLog(@"mouseMoved");
|
||||
if (ttWindow == nil)
|
||||
{
|
||||
return;
|
||||
}
|
||||
mouseLocation = [NSEvent mouseLocation];
|
||||
|
||||
origin = NSMakePoint(mouseLocation.x + 8,
|
||||
mouseLocation.y - 16 - [ttWindow frame].size.height);
|
||||
|
||||
[ttWindow setFrameOrigin:origin];
|
||||
}
|
||||
|
||||
// NSView methods
|
||||
- (NSToolTipTag)addToolTipRect:(NSRect)aRect
|
||||
owner:(id)anObject
|
||||
userData:(void *)data
|
||||
{
|
||||
SEL ownerSelector;
|
||||
NSTrackingRectTag tag;
|
||||
|
||||
if (NSEqualRects(aRect,NSZeroRect) || ttTimer != nil)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
ownerSelector = @selector(view:stringForToolTip:point:userData:);
|
||||
if (![anObject respondsToSelector:ownerSelector]
|
||||
&& ![anObject isKindOfClass:[NSString class]])
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Set rect tracking
|
||||
tag = [self addTrackingRect:aRect
|
||||
owner:self
|
||||
userData:data
|
||||
assumeInside:NO];
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
- (void)removeAllToolTips
|
||||
{
|
||||
int i, j;
|
||||
GSTrackingRect *tr = nil;
|
||||
|
||||
if (_hasTooltips == NO)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
[self _invalidateTimer];
|
||||
[self _closeToolTipWindow];
|
||||
|
||||
j = [_tracking_rects count];
|
||||
for (i = 0; i < j; i++)
|
||||
{
|
||||
tr = [_tracking_rects objectAtIndex:i];
|
||||
[self removeTrackingRect:tr->tag];
|
||||
}
|
||||
|
||||
mainToolTip = -1;
|
||||
_hasTooltips = NO;
|
||||
}
|
||||
|
||||
- (void)removeToolTip:(NSToolTipTag)tag
|
||||
{
|
||||
[self removeTrackingRect:tag];
|
||||
}
|
||||
|
||||
- (void)setToolTip:(NSString *)string
|
||||
{
|
||||
NSTrackingRectTag tag;
|
||||
NSRect rect;
|
||||
|
||||
if (string == nil) // Remove old tooltip
|
||||
{
|
||||
if (_hasTooltips)
|
||||
{
|
||||
[self _invalidateTimer];
|
||||
[self _closeToolTipWindow];
|
||||
[self removeToolTip:mainToolTip];
|
||||
mainToolTip = -1;
|
||||
_hasTooltips = NO;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// NSLog(@"setToolTip");
|
||||
rect = [self frame];
|
||||
rect.origin.x = 0;
|
||||
rect.origin.y = 0;
|
||||
tag = [self addTrackingRect:rect
|
||||
owner:self
|
||||
userData:string
|
||||
assumeInside:NO];
|
||||
_hasTooltips = YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)toolTip
|
||||
{
|
||||
NSEnumerator *enumerator = [_tracking_rects objectEnumerator];
|
||||
GSTrackingRect *tr = nil;
|
||||
|
||||
while ((tr = [enumerator nextObject]))
|
||||
{
|
||||
if (tr->tag == mainToolTip)
|
||||
{
|
||||
return tr->user_data;
|
||||
}
|
||||
}
|
||||
|
||||
return nil;
|
||||
}*/
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2002-2014 Free Software Foundation
|
||||
Copyright (C) 2002-2015 Free Software Foundation
|
||||
|
||||
Authors: Philippe C.D. Robert
|
||||
Serg Stoyan
|
||||
|
@ -21,7 +21,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCDefines.h>
|
||||
|
@ -30,10 +30,12 @@
|
|||
#import <ProjectCenter/PCBundleManager.h>
|
||||
#import <ProjectCenter/PCEditorManager.h>
|
||||
#import <ProjectCenter/PCProject.h>
|
||||
|
||||
#import <ProjectCenter/PCProjectEditor.h>
|
||||
#import <ProjectCenter/PCLogController.h>
|
||||
#import <ProjectCenter/PCSaveModified.h>
|
||||
|
||||
#import <Protocols/CodeEditor.h>
|
||||
|
||||
#import "Modules/Preferences/Misc/PCMiscPrefs.h"
|
||||
|
||||
NSString *PCEditorDidChangeFileNameNotification =
|
||||
|
@ -97,15 +99,6 @@ NSString *PCEditorDidResignActiveNotification =
|
|||
selector:@selector(editorDidChangeFileName:)
|
||||
name:PCEditorDidChangeFileNameNotification
|
||||
object:nil];
|
||||
|
||||
// Debugger
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver:self
|
||||
selector:@selector(debuggerDidHitBreakpoint:)
|
||||
name:PCProjectBreakpointNotification
|
||||
object:nil];
|
||||
|
||||
// Preferences
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -170,7 +163,7 @@ NSString *PCEditorDidResignActiveNotification =
|
|||
id<CodeParser> parser;
|
||||
BOOL exists = [fm fileExistsAtPath:filePath isDirectory:&isDir];
|
||||
|
||||
// Determine if file not exist or file is directory
|
||||
// Determine if file does not exist or file is directory
|
||||
if (!exists)
|
||||
{
|
||||
NSRunAlertPanel(@"Open Editor",
|
||||
|
@ -191,15 +184,31 @@ NSString *PCEditorDidResignActiveNotification =
|
|||
@"Couldn't open editor for file '%@'.\n"
|
||||
@"File is not plain text.",
|
||||
@"Close", nil, nil, filePath);*/
|
||||
PCLogInfo(self, @"Not a text file %@", filePath);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *app;
|
||||
|
||||
/* we don't have in-window editors for any bundles right now */
|
||||
if (!windowed)
|
||||
return nil;
|
||||
|
||||
/* Check for bundles and if possible let them be opened by Workspace but only if windowed */
|
||||
app = [[NSWorkspace sharedWorkspace] getBestAppInRole:@"Editor" forExtension:[fileName pathExtension]];
|
||||
if (windowed && app != nil)
|
||||
{
|
||||
if ([[NSWorkspace sharedWorkspace] openFile: filePath])
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
// NSLog(@"EditorManager 1: %@", _editorsDict);
|
||||
editor = [_editorsDict objectForKey: filePath];
|
||||
if (editor == nil)
|
||||
{
|
||||
NSLog(@"Opening new editor. Editor: %@", editorName);
|
||||
// Editor
|
||||
editor = [bundleManager objectForBundleWithName:editorName
|
||||
type:@"editor"
|
||||
|
@ -210,33 +219,33 @@ NSString *PCEditorDidResignActiveNotification =
|
|||
objectForBundleWithName:@"ProjectCenter"
|
||||
type:@"editor"
|
||||
protocol:@protocol(CodeEditor)];
|
||||
if (editor == nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
// Parser
|
||||
parser = [bundleManager objectForBundleType:@"parser"
|
||||
protocol:@protocol(CodeParser)
|
||||
fileName:fileName];
|
||||
if(parser != nil)
|
||||
{
|
||||
[editor setParser:parser];
|
||||
[editor openFileAtPath:filePath
|
||||
editorManager:self
|
||||
editable:editable];
|
||||
[_editorsDict setObject:editor forKey:filePath];
|
||||
RELEASE(editor);
|
||||
}
|
||||
|
||||
/* if we have a valid editor, we try to set a parser */
|
||||
if (editor)
|
||||
{
|
||||
// Parser
|
||||
parser = [bundleManager objectForBundleType:@"parser"
|
||||
protocol:@protocol(CodeParser)
|
||||
fileName:fileName];
|
||||
if(parser != nil)
|
||||
{
|
||||
[editor setParser:parser];
|
||||
}
|
||||
[editor openFileAtPath:filePath
|
||||
editorManager:self
|
||||
editable:editable];
|
||||
[_editorsDict setObject:editor forKey:filePath];
|
||||
RELEASE(editor);
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// If we don't have an editor or a parser, we fall back to opening the
|
||||
// file with the editor designated by the system.
|
||||
//
|
||||
[[NSWorkspace sharedWorkspace] openFile: filePath];
|
||||
}
|
||||
{
|
||||
//
|
||||
// If we don't have an editor, we fall back to opening the
|
||||
// file with the editor designated by the system.
|
||||
//
|
||||
[[NSWorkspace sharedWorkspace] openFile: filePath];
|
||||
}
|
||||
}
|
||||
|
||||
if(editor != nil)
|
||||
|
@ -526,16 +535,15 @@ NSString *PCEditorDidResignActiveNotification =
|
|||
[_editorsDict setObject:_editor forKey:_newFileName];
|
||||
}
|
||||
|
||||
- (void)debuggerDidHitBreakpoint:(NSNotification *)aNotif
|
||||
- (void)gotoFile: (NSString *)fileName atLine: (NSUInteger)line
|
||||
{
|
||||
id object = [aNotif object];
|
||||
NSString *filePath = [object objectForKey: @"file"];
|
||||
NSString *line = [object objectForKey: @"line"];
|
||||
id<CodeEditor> editor = [self openEditorForFile: filePath
|
||||
editable: YES
|
||||
windowed: NO];
|
||||
[self orderFrontEditorForFile:filePath];
|
||||
[editor scrollToLineNumber: [line integerValue]];
|
||||
PCProject *project = [_projectManager rootActiveProject];
|
||||
PCProjectEditor *pe = [project projectEditor];
|
||||
|
||||
id<CodeEditor> editor = [pe openEditorForFilePath: fileName windowed: NO];
|
||||
|
||||
// [self orderFrontEditorForFile:fileName];
|
||||
[editor scrollToLineNumber: line];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2001-2013 Free Software Foundation
|
||||
Copyright (C) 2001-2015 Free Software Foundation
|
||||
|
||||
Authors: Philippe C.D. Robert
|
||||
Serg Stoyan
|
||||
|
@ -21,7 +21,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCDefines.h>
|
||||
|
@ -44,6 +44,7 @@ static NSDictionary *dict = nil;
|
|||
NSDictionary *headerDict;
|
||||
NSDictionary *ccDict;
|
||||
NSDictionary *chDict;
|
||||
NSDictionary *classPpDict;
|
||||
NSDictionary *protocolDict;
|
||||
NSDictionary *gsmarkupDict;
|
||||
NSString *descr;
|
||||
|
@ -108,6 +109,17 @@ static NSDictionary *dict = nil;
|
|||
template,@"TemplateFile",
|
||||
nil];
|
||||
|
||||
// Objective C++ Class
|
||||
descr = @"Generic Objective-C++ class.\n\n"
|
||||
@"This is a plain subclass of NSObject which includes"
|
||||
@" only Foundation.h. Extend it with c++";
|
||||
template = [bundle pathForResource:@"ocppclass" ofType:@"template"];
|
||||
classPpDict = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
PCClasses, @"ProjectKey",
|
||||
descr, @"TypeDescription",
|
||||
template,@"TemplateFile",
|
||||
nil];
|
||||
|
||||
// GSMarkup
|
||||
descr = @"Generic GSMarkup File.\n\n"
|
||||
@"This is the interface description of GNUstep Renaissance.";
|
||||
|
@ -125,6 +137,7 @@ static NSDictionary *dict = nil;
|
|||
protocolDict, ProtocolFile,
|
||||
headerDict, ObjCHeader,
|
||||
classDict, ObjCClass,
|
||||
classPpDict, ObjCppClass,
|
||||
gsmarkupDict, GSMarkupFile,
|
||||
nil];
|
||||
}
|
||||
|
@ -195,6 +208,12 @@ static NSDictionary *dict = nil;
|
|||
newFile = [path stringByAppendingPathExtension:@"m"];
|
||||
[files setObject:[dict objectForKey:ObjCClass] forKey:newFile];
|
||||
}
|
||||
// Objective-C++ Class
|
||||
else if ([type isEqualToString:ObjCppClass])
|
||||
{
|
||||
newFile = [path stringByAppendingPathExtension:@"mm"];
|
||||
[files setObject:[dict objectForKey:ObjCppClass] forKey:newFile];
|
||||
}
|
||||
// C File
|
||||
else if ([type isEqualToString:CFile])
|
||||
{
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2000-2011 Free Software Foundation
|
||||
Copyright (C) 2000-2022 Free Software Foundation
|
||||
|
||||
Authors: Philippe C.D. Robert
|
||||
Serg Stoyan
|
||||
Riccardo Mottola
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -20,7 +21,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCDefines.h>
|
||||
|
@ -352,8 +353,6 @@ static PCFileManager *_mgr = nil;
|
|||
while (nil != (candidate = [candidateEnumerator nextObject]))
|
||||
{
|
||||
NSString *path = [directory stringByAppendingPathComponent: candidate];
|
||||
|
||||
NSLog(@"final candidate path is: %@", path);
|
||||
|
||||
if ([manager isExecutableFileAtPath: path])
|
||||
{
|
||||
|
@ -416,6 +415,12 @@ static PCFileManager *_mgr = nil;
|
|||
}
|
||||
panel = addFilesPanel;
|
||||
lastOpenDir = [prefs stringForKey:@"FileAddLastDirectory"];
|
||||
if (lastOpenDir == nil)
|
||||
{
|
||||
PCProject *pr = [projectManager activeProject];
|
||||
NSString *prPathRoot = [pr projectPath];
|
||||
lastOpenDir = prPathRoot;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return nil;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCLogController.h>
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2002-2010 Free Software Foundation
|
||||
Copyright (C) 2002-2014 Free Software Foundation
|
||||
|
||||
Authors: Philippe C.D. Robert
|
||||
Serg Stoyan
|
||||
Riccardo Mottola
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -20,7 +21,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCDefines.h>
|
||||
|
@ -33,7 +34,8 @@
|
|||
|
||||
#define COMMENT_HEADERS @"\n\n#\n# Header files\n#\n"
|
||||
#define COMMENT_RESOURCES @"\n\n#\n# Resource files\n#\n"
|
||||
#define COMMENT_CLASSES @"\n\n#\n# Class files\n#\n"
|
||||
#define COMMENT_CLASSES @"\n\n#\n# Objective-C Class files\n#\n"
|
||||
#define COMMENT_OCPPCLASSES @"\n\n#\n# Objective-C++ Class files\n#\n"
|
||||
#define COMMENT_CFILES @"\n\n#\n# Other sources\n#\n"
|
||||
#define COMMENT_SUBPROJECTS @"\n\n#\n# Subprojects\n#\n"
|
||||
#define COMMENT_APP @"\n\n#\n# Main application\n#\n"
|
||||
|
@ -84,6 +86,18 @@ static PCMakefileFactory *_factory = nil;
|
|||
[mfile appendString: @"ifeq ($(GNUSTEP_MAKEFILES),)\n"];
|
||||
[mfile appendString: @" GNUSTEP_MAKEFILES := $(shell gnustep-config "];
|
||||
[mfile appendString: @"--variable=GNUSTEP_MAKEFILES 2>/dev/null)\n"];
|
||||
[mfile appendString: @" ifeq ($(GNUSTEP_MAKEFILES),)\n"];
|
||||
[mfile appendString: @" $(warning )\n"];
|
||||
[mfile appendString: @" $(warning Unable to obtain GNUSTEP_MAKEFILES"];
|
||||
[mfile appendString: @" setting from gnustep-config!)\n"];
|
||||
[mfile appendString: @" $(warning Perhaps gnustep-make is not properly"];
|
||||
[mfile appendString: @" installed,)\n"];
|
||||
[mfile appendString: @" $(warning so gnustep-config is not in your"];
|
||||
[mfile appendString: @" PATH.)\n"];
|
||||
[mfile appendString: @" $(warning )\n"];
|
||||
[mfile appendString: @" $(warning Your PATH is currently $(PATH))\n"];
|
||||
[mfile appendString: @" $(warning )\n"];
|
||||
[mfile appendString: @" endif\n"];
|
||||
[mfile appendString: @"endif\n"];
|
||||
[mfile appendString: @"ifeq ($(GNUSTEP_MAKEFILES),)\n"];
|
||||
[mfile appendString: @" $(error You need to set GNUSTEP_MAKEFILES"];
|
||||
|
@ -337,16 +351,50 @@ static PCMakefileFactory *_factory = nil;
|
|||
|
||||
- (void)appendClasses:(NSArray *)array forTarget:(NSString *)target
|
||||
{
|
||||
NSEnumerator *oenum;
|
||||
NSMutableArray *marray = nil;
|
||||
NSMutableArray *mmarray = nil;
|
||||
NSString *file;
|
||||
|
||||
if (array == nil || [array count] == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
[self appendString:COMMENT_CLASSES];
|
||||
[self appendString:
|
||||
[NSString stringWithFormat: @"%@_OBJC_FILES = \\\n",target]];
|
||||
oenum = [array objectEnumerator];
|
||||
while ((file = [oenum nextObject]))
|
||||
{
|
||||
if ([file hasSuffix: @".m"])
|
||||
{
|
||||
if (marray == nil)
|
||||
{
|
||||
marray = [NSMutableArray array];
|
||||
}
|
||||
[marray addObject: file];
|
||||
}
|
||||
else if ([file hasSuffix: @".mm"])
|
||||
{
|
||||
if (mmarray == nil)
|
||||
{
|
||||
mmarray = [NSMutableArray array];
|
||||
}
|
||||
[mmarray addObject: file];
|
||||
}
|
||||
}
|
||||
|
||||
[self appendString: [array componentsJoinedByString: @" \\\n"]];
|
||||
if (marray)
|
||||
{
|
||||
[self appendString:COMMENT_CLASSES];
|
||||
[self appendString: [NSString stringWithFormat: @"%@_OBJC_FILES = \\\n",target]];
|
||||
[self appendString: [marray componentsJoinedByString: @" \\\n"]];
|
||||
}
|
||||
|
||||
if (mmarray)
|
||||
{
|
||||
[self appendString:COMMENT_OCPPCLASSES];
|
||||
[self appendString: [NSString stringWithFormat: @"%@_OBJCC_FILES = \\\n",target]];
|
||||
[self appendString: [mmarray componentsJoinedByString: @" \\\n"]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)appendOtherSources:(NSArray *)array
|
||||
|
@ -362,6 +410,7 @@ static PCMakefileFactory *_factory = nil;
|
|||
- (void)appendOtherSources:(NSArray *)array forTarget: (NSString *)target
|
||||
{
|
||||
NSMutableArray *marray = nil;
|
||||
NSMutableArray *mmarray = nil;
|
||||
NSMutableArray *oarray = nil;
|
||||
NSEnumerator *oenum;
|
||||
NSString *file;
|
||||
|
@ -383,6 +432,14 @@ static PCMakefileFactory *_factory = nil;
|
|||
}
|
||||
[marray addObject: file];
|
||||
}
|
||||
else if ([file hasSuffix: @".mm"])
|
||||
{
|
||||
if (mmarray == nil)
|
||||
{
|
||||
mmarray = [NSMutableArray array];
|
||||
}
|
||||
[mmarray addObject: file];
|
||||
}
|
||||
else // non .m file
|
||||
{
|
||||
if (oarray == nil)
|
||||
|
@ -416,6 +473,19 @@ static PCMakefileFactory *_factory = nil;
|
|||
|
||||
[self appendString: [NSString stringWithFormat: @"%@_OBJC_FILES += ",pnme]];
|
||||
|
||||
while ((file = [oenum nextObject]))
|
||||
{
|
||||
[self appendString: [NSString stringWithFormat: @"\\\n%@ ", file]];
|
||||
}
|
||||
}
|
||||
|
||||
// Add .mm files if any
|
||||
if (mmarray && [marray count] != 0)
|
||||
{
|
||||
oenum = [mmarray objectEnumerator];
|
||||
|
||||
[self appendString: [NSString stringWithFormat: @"%@_OBJCC_FILES += ",pnme]];
|
||||
|
||||
while ((file = [oenum nextObject]))
|
||||
{
|
||||
[self appendString: [NSString stringWithFormat: @"\\\n%@ ", file]];
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2000-2010 Free Software Foundation
|
||||
Copyright (C) 2000-2014 Free Software Foundation
|
||||
|
||||
Authors: Philippe C.D. Robert
|
||||
Serg Stoyan
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
// TODO: Split into several files with categories
|
||||
|
@ -60,6 +60,11 @@ NSString
|
|||
|
||||
@implementation PCProject
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
return [NSString stringWithFormat: @"%@: %@ (%@)", [self className], projectName, projectPath];
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ==== Init and free
|
||||
// ============================================================================
|
||||
|
@ -472,11 +477,11 @@ NSString
|
|||
- (BOOL)save
|
||||
{
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
int spCount = [loadedSubprojects count];
|
||||
NSUInteger spCount = [loadedSubprojects count];
|
||||
int i;
|
||||
NSString *wrapperFile = [projectName stringByAppendingPathExtension: @"pcproj"];
|
||||
NSString *wrapperFile;
|
||||
NSString *file = @"PC.project";
|
||||
NSString *backup = [wrapperPath stringByAppendingPathExtension:@"backup"];
|
||||
NSString *backup;
|
||||
NSMutableDictionary *dict = [projectDict mutableCopy];
|
||||
NSData *dictData = nil;
|
||||
|
||||
|
@ -484,10 +489,12 @@ NSString
|
|||
[dict removeObjectForKey: PCWindows];
|
||||
[dict removeObjectForKey: PCLastEditing];
|
||||
|
||||
// initialize the wrapper...
|
||||
// initialize the wrappers..
|
||||
wrapperFile = [projectName stringByAppendingPathExtension: @"pcproj"];
|
||||
projectFileWrapper = [[NSFileWrapper alloc] initDirectoryWithFileWrappers:
|
||||
[NSMutableDictionary dictionaryWithCapacity: 3]];
|
||||
wrapperPath = [projectPath stringByAppendingPathComponent: wrapperFile];
|
||||
backup = [wrapperPath stringByAppendingPathExtension:@"backup"];
|
||||
|
||||
// load subprojects...
|
||||
for (i = 0; i < spCount; i++)
|
||||
|
@ -973,7 +980,7 @@ NSString
|
|||
{
|
||||
if ([key isEqualToString:PCClasses])
|
||||
{
|
||||
return [NSArray arrayWithObjects:@"m",nil];
|
||||
return [NSArray arrayWithObjects:@"m",@"mm",nil];
|
||||
}
|
||||
else if ([key isEqualToString:PCHeaders])
|
||||
{
|
||||
|
@ -1461,10 +1468,13 @@ NSString
|
|||
|
||||
_editorCategory = [[_editor categoryPath] mutableCopy];
|
||||
range = [_editorCategory rangeOfString:fromFile];
|
||||
[_editorCategory replaceCharactersInRange:range withString:toFile];
|
||||
|
||||
[_editor setCategoryPath:_editorCategory];
|
||||
[projectBrowser setPath:_editorCategory];
|
||||
if (range.location != NSNotFound)
|
||||
{
|
||||
[_editorCategory replaceCharactersInRange:range withString:toFile];
|
||||
|
||||
[_editor setCategoryPath:_editorCategory];
|
||||
[projectBrowser setPath:_editorCategory];
|
||||
}
|
||||
RELEASE(_editorCategory);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCDefines.h>
|
||||
|
@ -442,13 +442,15 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
|||
|
||||
if ([self nameOfSelectedFile] != nil)
|
||||
{
|
||||
BOOL foundFile = NO;
|
||||
BOOL foundApp = NO;
|
||||
// PCLogInfo(self, @"{doubleClick} filePath: %@", filePath);*/
|
||||
|
||||
workspace = [NSWorkspace sharedWorkspace];
|
||||
foundApp = [workspace getInfoForFile:filePath
|
||||
foundFile = [workspace getInfoForFile:filePath
|
||||
application:&appName
|
||||
type:&type];
|
||||
foundApp = foundFile && appName;
|
||||
// NSLog (@"Open file: %@ with app: %@", filePath, appName);
|
||||
|
||||
// If 'Editor' role was set in .GNUstepExtPrefs application
|
||||
|
@ -599,7 +601,6 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
|||
{
|
||||
NSString *categoryName = nil;
|
||||
NSString *fileName = nil;
|
||||
NSString *fileExtension = nil;
|
||||
NSString *iconName = nil;
|
||||
NSImage *icon = nil;
|
||||
PCProject *activeProject = [[project projectManager] activeProject];
|
||||
|
@ -611,7 +612,6 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
|||
{
|
||||
return icon;
|
||||
}
|
||||
fileExtension = [fileName pathExtension];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
|
@ -220,6 +220,11 @@
|
|||
[logOutput setSelectable:YES];
|
||||
[logOutput setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
|
||||
[logOutput setBackgroundColor:[NSColor lightGrayColor]];
|
||||
[logOutput setSelectedTextAttributes:
|
||||
[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSColor whiteColor], NSBackgroundColorAttributeName,
|
||||
[NSColor blackColor], NSForegroundColorAttributeName,
|
||||
nil]];
|
||||
[[logOutput textContainer] setWidthTracksTextView:YES];
|
||||
[[logOutput textContainer] setHeightTracksTextView:YES];
|
||||
[logOutput setHorizontallyResizable:NO];
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCProjectBuilderOptions.h>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCProjectManager.h>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2002-2010 Free Software Foundation
|
||||
Copyright (C) 2002-2015 Free Software Foundation
|
||||
|
||||
Authors: Philippe C.D. Robert
|
||||
Serg Stoyan
|
||||
|
@ -21,7 +21,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCDefines.h>
|
||||
|
@ -177,6 +177,54 @@
|
|||
return NO;
|
||||
}
|
||||
|
||||
- (id<CodeEditor>) openEditorForFilePath: (NSString *)filePath
|
||||
windowed: (BOOL)windowed
|
||||
{
|
||||
PCProject *activeProject = [[_project projectManager] activeProject];
|
||||
NSString *fileName = [filePath lastPathComponent];
|
||||
BOOL editable = YES;
|
||||
id<CodeEditor> editor = nil;
|
||||
NSFileManager *mgr = [NSFileManager defaultManager];
|
||||
|
||||
NSLog(@"PCPE: fileName: %@, filePath: %@, project: %@",
|
||||
fileName, filePath, [activeProject projectName]);
|
||||
|
||||
if (![mgr fileExistsAtPath: filePath])
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Determine if file should be opened for read only
|
||||
if (![_project isEditableFile:fileName])
|
||||
{
|
||||
editable = NO;
|
||||
}
|
||||
|
||||
// Set the 'editor' var either by requesting already opened
|
||||
// editor or by creating the new one.
|
||||
editor = [self openEditorForFile:filePath
|
||||
editable:editable
|
||||
windowed:windowed];
|
||||
if (!editor)
|
||||
{
|
||||
NSLog(@"We don't have editor for file: %@", fileName);
|
||||
[self setActiveEditor: nil];
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Category path was changed by user's clicking inside browser.
|
||||
// That's why new category path must be transfered to editor.
|
||||
NSString *categoryPath = [NSString stringWithFormat: @"/Classes/%@/", fileName];
|
||||
[editor setCategoryPath:categoryPath];
|
||||
[self orderFrontEditorForFile:filePath];
|
||||
|
||||
// Reload last column because editor has just been loaded
|
||||
[[_project projectBrowser] reloadLastColumnAndNotify:NO];
|
||||
[editor fileStructureItemSelected:fileName];
|
||||
|
||||
return editor;
|
||||
}
|
||||
|
||||
// Called by PCProjectBrowser
|
||||
// categoryPath:
|
||||
// 1. "/Classes/Class.m/- init"
|
||||
|
@ -218,6 +266,7 @@
|
|||
if (!editor)
|
||||
{
|
||||
NSLog(@"We don't have editor for file: %@", fileName);
|
||||
[self setActiveEditor: nil];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -226,8 +275,8 @@
|
|||
[editor setCategoryPath:categoryPath];
|
||||
[self orderFrontEditorForFile:filePath];
|
||||
|
||||
/* pathLastObject = [pathArray lastObject];
|
||||
NSLog(@"pathArray: c: %i %@", [pathArray count], pathArray);
|
||||
pathLastObject = [pathArray lastObject];
|
||||
/* NSLog(@"pathArray: c: %i %@", [pathArray count], pathArray);
|
||||
NSLog(@"pathArray: lastObject %@", [pathArray lastObject]);
|
||||
NSLog(@"lastObject[1]: %@",
|
||||
[pathLastObject substringWithRange:NSMakeRange(0,1)]);*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2000-2010 Free Software Foundation
|
||||
Copyright (C) 2000-2023 Free Software Foundation
|
||||
|
||||
Authors: Philippe C.D. Robert
|
||||
Serg Stoyan
|
||||
|
@ -22,7 +22,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCDefines.h>
|
||||
|
@ -417,19 +417,19 @@
|
|||
|
||||
if ([selectedTitle isEqualToString:@"Header Directories Search Order"])
|
||||
{
|
||||
ASSIGN(searchItems, searchHeaders);
|
||||
ASSIGN(searchItems, [NSMutableArray arrayWithArray:searchHeaders]);
|
||||
}
|
||||
else if ([selectedTitle isEqualToString:@"Library Directories Search Order"])
|
||||
{
|
||||
ASSIGN(searchItems, searchLibs);
|
||||
ASSIGN(searchItems, [NSMutableArray arrayWithArray:searchLibs]);
|
||||
}
|
||||
else if ([selectedTitle isEqualToString:@"Build Targets"])
|
||||
{
|
||||
ASSIGN(searchItems,[project buildTargets]);
|
||||
ASSIGN(searchItems,[NSMutableArray arrayWithArray:[project buildTargets]]);
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSIGN(searchItems,nil);
|
||||
DESTROY(searchItems);
|
||||
}
|
||||
|
||||
[searchOrderList reloadData];
|
||||
|
@ -977,8 +977,18 @@
|
|||
|
||||
- (void)fileNameDidChange:(id)sender
|
||||
{
|
||||
if ([fileName isEqualToString:[fileNameField stringValue]])
|
||||
NSString *newName;
|
||||
|
||||
newName = [fileNameField stringValue];
|
||||
if ([fileName isEqualToString:newName])
|
||||
{
|
||||
[fileNameField setStringValue:fileName];
|
||||
return;
|
||||
}
|
||||
if ([[newName stringByTrimmingCharactersInSet:
|
||||
[NSCharacterSet whitespaceAndNewlineCharacterSet]] length] == 0)
|
||||
{
|
||||
[fileNameField setStringValue:fileName];
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2000-2014 Free Software Foundation
|
||||
Copyright (C) 2000-2020 Free Software Foundation
|
||||
|
||||
Authors: Philippe C.D. Robert
|
||||
Serg Stoyan
|
||||
Riccardo Mottola
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -20,7 +21,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
|
@ -32,15 +33,19 @@
|
|||
#import <ProjectCenter/PCBundleManager.h>
|
||||
#import <ProjectCenter/PCButton.h>
|
||||
#import <ProjectCenter/PCLogController.h>
|
||||
#import <Protocols/Preferences.h>
|
||||
|
||||
|
||||
#import "Modules/Preferences/Misc/PCMiscPrefs.h"
|
||||
#import "Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h"
|
||||
|
||||
|
||||
#ifndef NOTIFICATION_CENTER
|
||||
#define NOTIFICATION_CENTER [NSNotificationCenter defaultCenter]
|
||||
#endif
|
||||
|
||||
#ifndef IMAGE
|
||||
#define IMAGE(X) [[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:(X)]] autorelease]
|
||||
#define IMAGE(X) [NSImage imageNamed: X]
|
||||
#endif
|
||||
|
||||
enum {
|
||||
|
@ -144,10 +149,20 @@ enum {
|
|||
|
||||
if ((self = [super init]))
|
||||
{
|
||||
NSFont *font = [NSFont userFixedPitchFontOfSize: 10.0];
|
||||
id <PCPreferences> prefs;
|
||||
NSFont *font;
|
||||
NSString *fontName;
|
||||
CGFloat fontSize;
|
||||
|
||||
project = aProject;
|
||||
|
||||
prefs = [[project projectManager] prefController];
|
||||
fontName = [prefs stringForKey:ConsoleFixedFont];
|
||||
fontSize = [prefs floatForKey:ConsoleFixedFontSize];
|
||||
font = [NSFont fontWithName:fontName size:fontSize];
|
||||
if (font == nil)
|
||||
font = [NSFont userFixedPitchFontOfSize:0];
|
||||
|
||||
textAttributes =
|
||||
[NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName];
|
||||
[textAttributes retain];
|
||||
|
@ -206,14 +221,33 @@ enum {
|
|||
|
||||
- (void)debug:(id)sender
|
||||
{
|
||||
NSString *projectName = [project projectName];
|
||||
NSString *fp = nil;
|
||||
NSString *executablePath;
|
||||
NSString *gdbPath = nil;
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
PCBundleManager *bundleManager = [[project projectManager] bundleManager];
|
||||
|
||||
// Check if project type is executable
|
||||
if (![project isExecutable])
|
||||
executablePath = [project projectPath];
|
||||
|
||||
if ([project isExecutable])
|
||||
{
|
||||
NSString *prjType;
|
||||
|
||||
prjType = [project projectTypeName];
|
||||
if ([prjType isEqualToString: @"Application"])
|
||||
{
|
||||
/* MyApplication.app/MyApplication */
|
||||
executablePath = [executablePath stringByAppendingPathComponent:[project projectName]];
|
||||
executablePath = [executablePath stringByAppendingString:@".app"];
|
||||
executablePath = [executablePath stringByAppendingPathComponent:[project projectName]];
|
||||
}
|
||||
else if ([prjType isEqualToString: @"Tool"])
|
||||
{
|
||||
/* obj/MyTool */
|
||||
executablePath = [executablePath stringByAppendingPathComponent:@"obj"];
|
||||
executablePath = [executablePath stringByAppendingPathComponent:[project projectName]];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSRunAlertPanel(@"Debug",
|
||||
@"The project is not executable",
|
||||
|
@ -222,31 +256,16 @@ enum {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
/* We try in the order:
|
||||
* xxx.debug/xxx (gnustep-make v1, application),
|
||||
* xxx.app/xxx (gnustep-make v1 and v2, application),
|
||||
* obj/xxx (gnustep-make v1 and v2, tool).
|
||||
*/
|
||||
fp = [project projectPath];
|
||||
fp = [fp stringByAppendingPathComponent: [projectName stringByAppendingPathExtension: @"debug"]];
|
||||
fp = [fp stringByAppendingPathComponent: projectName];
|
||||
|
||||
if (! [fm isExecutableFileAtPath: fp])
|
||||
#ifdef __MINGW__
|
||||
/* On windows we need to check the .exe file */
|
||||
if ([[executablePath pathExtension] length] == 0)
|
||||
{
|
||||
fp = [project projectPath];
|
||||
fp = [fp stringByAppendingPathComponent: [projectName stringByAppendingPathExtension: @"app"]];
|
||||
fp = [fp stringByAppendingPathComponent: projectName];
|
||||
|
||||
if (! [fm isExecutableFileAtPath: fp])
|
||||
{
|
||||
fp = [project projectPath];
|
||||
fp = [fp stringByAppendingPathComponent: @"obj"];
|
||||
fp = [fp stringByAppendingPathComponent: projectName];
|
||||
}
|
||||
executablePath = [executablePath stringByAppendingPathExtension: @"exe"];
|
||||
}
|
||||
#endif
|
||||
|
||||
if ([fm isExecutableFileAtPath:fp] == NO)
|
||||
NSLog(@"debug executable launch path: %@", executablePath);
|
||||
if ([fm isExecutableFileAtPath:executablePath] == NO)
|
||||
{
|
||||
NSRunAlertPanel(@"Debug",
|
||||
@"No executable! Please build the project first.",
|
||||
|
@ -274,11 +293,21 @@ enum {
|
|||
|
||||
|
||||
// Debugger
|
||||
debugger = [bundleManager objectForBundleType: @"debugger"
|
||||
protocol: @protocol(CodeDebugger)
|
||||
fileName: [fp stringByDeletingLastPathComponent]];
|
||||
[debugger debugExecutableAtPath: fp
|
||||
withDebugger: gdbPath];
|
||||
if (nil == debugger)
|
||||
{
|
||||
debugger = [bundleManager objectForBundleType: @"debugger"
|
||||
protocol: @protocol(CodeDebugger)
|
||||
fileName: [executablePath stringByDeletingLastPathComponent]];
|
||||
[debugger debugExecutableAtPath: executablePath
|
||||
withDebugger: gdbPath];
|
||||
}
|
||||
else
|
||||
{
|
||||
[debugger show];
|
||||
}
|
||||
|
||||
if (nil == debugger)
|
||||
NSLog(@"No debugger module found");
|
||||
|
||||
// turn debug button off...
|
||||
// [debugButton setState:NSOffState];
|
||||
|
@ -292,7 +321,7 @@ enum {
|
|||
NSString *executablePath;
|
||||
NSFileManager *fm;
|
||||
|
||||
executablePath = [NSMutableString stringWithString:[project projectPath]];
|
||||
executablePath = [project projectPath];
|
||||
|
||||
// Check if project type is executable
|
||||
if ([project isExecutable])
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCProjectManager.h>
|
||||
|
@ -35,14 +35,10 @@
|
|||
|
||||
- (id)initWithProjectManager:(PCProjectManager *)aManager
|
||||
{
|
||||
PCProjectLauncher *projectLauncher = nil;
|
||||
PCProject *activeProject = nil;
|
||||
|
||||
projectManager = aManager;
|
||||
activeProject = [projectManager rootActiveProject];
|
||||
projectLauncher = [activeProject projectLauncher];
|
||||
|
||||
projectLauncher = [[aManager activeProject] projectLauncher];
|
||||
|
||||
self = [super initWithContentRect: NSMakeRect (0, 300, 480, 322)
|
||||
styleMask: (NSTitledWindowMask
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCDefines.h>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCProjectManager.h>
|
||||
|
@ -35,13 +35,11 @@
|
|||
|
||||
- (id)initWithProjectManager:(PCProjectManager *)aManager
|
||||
{
|
||||
PCProjectLoadedFiles *projectLoadedFiles = nil;
|
||||
PCProject *activeProject = nil;
|
||||
|
||||
projectManager = aManager;
|
||||
activeProject = [projectManager rootActiveProject];
|
||||
currentProject = activeProject;
|
||||
projectLoadedFiles = [activeProject projectLoadedFiles];
|
||||
|
||||
PCLogStatus(self, @"[init]");
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2000-2010 Free Software Foundation
|
||||
Copyright (C) 2000-2021 Free Software Foundation
|
||||
|
||||
Authors: Philippe C.D. Robert
|
||||
Serg Stoyan
|
||||
|
@ -21,7 +21,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCDefines.h>
|
||||
|
@ -380,7 +380,7 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName:PCActiveProjectDidChangeNotification
|
||||
object:activeProject];
|
||||
object:activeProject];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -552,7 +552,6 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
NSString *projectPath = nil;
|
||||
NSString *projectFileType = nil;
|
||||
PCProject *project = nil;
|
||||
NSDictionary *wap = nil;
|
||||
NSString *projectPathToSave;
|
||||
|
||||
// Check project path for invalid characters
|
||||
|
@ -675,14 +674,13 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
[self startSaveTimer];
|
||||
[project validateProjectDict];
|
||||
|
||||
if (!project)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
[loadedProjects setObject:project forKey:[project projectPath]];
|
||||
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL: [NSURL fileURLWithPath:projectPathToSave]];
|
||||
PCLogStatus(self, @"Saved opened Document as %@", projectPathToSave);
|
||||
|
||||
if (flag)
|
||||
{
|
||||
NSDictionary *wap = nil;
|
||||
[project setProjectManager:self];
|
||||
|
||||
// Windows and panels
|
||||
|
@ -699,14 +697,18 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
{
|
||||
[[project projectWindow] showProjectLoadedFiles:self];
|
||||
}
|
||||
|
||||
[[project projectWindow] makeKeyAndOrderFront:self];
|
||||
[self setActiveProject: project];
|
||||
}
|
||||
PCLogStatus(self, @"Saved opened Document as %@", projectPathToSave);
|
||||
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL: [NSURL fileURLWithPath:projectPathToSave]];
|
||||
}
|
||||
else
|
||||
{
|
||||
PCLogStatus(self, @"Project %@ already Open", [project projectName]);
|
||||
}
|
||||
|
||||
if (flag)
|
||||
{
|
||||
[self setActiveProject: project];
|
||||
[[project projectWindow] makeKeyAndOrderFront:self];
|
||||
}
|
||||
|
||||
return project;
|
||||
}
|
||||
|
@ -759,6 +761,7 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
NSString *className = [projectTypes objectForKey:projectType];
|
||||
PCProject<ProjectType> *projectCreator;
|
||||
PCProject *project = nil;
|
||||
NSString *subType = nil;
|
||||
|
||||
if ((project = [loadedProjects objectForKey: [aPath stringByDeletingLastPathComponent]]) != nil)
|
||||
{
|
||||
|
@ -766,6 +769,9 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
return project;
|
||||
}
|
||||
|
||||
if ([projectType isEqualToString:@"Application"])
|
||||
subType = PCProjectInterfaceGorm;
|
||||
|
||||
projectCreator = [bundleManager objectForClassName:className
|
||||
bundleType:@"project"
|
||||
protocol:@protocol(ProjectType)];
|
||||
|
@ -791,7 +797,7 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
}
|
||||
|
||||
// Create project
|
||||
if (!(project = [projectCreator createProjectAt:aPath]))
|
||||
if (!(project = [projectCreator createProjectAt:aPath withOption:subType]))
|
||||
{
|
||||
NSRunAlertPanel(@"New Project",
|
||||
@"Project %@ could not be created.\nReport bug, please!",
|
||||
|
@ -811,7 +817,7 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
NSString *filePath;
|
||||
NSString *projectType;
|
||||
PCProject *project;
|
||||
|
||||
NSString *projectPath;
|
||||
|
||||
[self createProjectTypeAccessaryView];
|
||||
|
||||
|
@ -852,7 +858,9 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
return;
|
||||
}
|
||||
|
||||
[loadedProjects setObject:project forKey: [project projectPath]];
|
||||
projectPath = [project projectPath];
|
||||
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:[NSURL fileURLWithPath:projectPath]];
|
||||
[loadedProjects setObject:project forKey:projectPath];
|
||||
[self setActiveProject:project];
|
||||
[[project projectWindow] orderFront:self];
|
||||
}
|
||||
|
@ -1116,6 +1124,7 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
// ============================================================================
|
||||
|
||||
- (void)openFileAtPath:(NSString *)filePath
|
||||
windowed:(BOOL)windowed
|
||||
{
|
||||
editorManager = [self editorManager];
|
||||
|
||||
|
@ -1123,11 +1132,17 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
{
|
||||
[editorManager openEditorForFile:filePath
|
||||
editable:YES
|
||||
windowed:YES];
|
||||
windowed:windowed];
|
||||
[editorManager orderFrontEditorForFile:filePath];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)openFileAtPath:(NSString *)filePath
|
||||
{
|
||||
[self openFileAtPath: filePath windowed: YES];
|
||||
}
|
||||
|
||||
|
||||
- (void)openFile
|
||||
{
|
||||
NSArray *files = nil;
|
||||
|
@ -1333,6 +1348,9 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
// Create subproject
|
||||
subproject = [self createSubprojectOfType:spType path:spPath];
|
||||
|
||||
// PCLogInfo(self, @"{createSubproject} add to %@", [activeProject projectName]);
|
||||
[activeProject addSubproject:subproject];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1342,11 +1360,15 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
NSString *className = [projectTypes objectForKey:projectType];
|
||||
PCProject<ProjectType> *projectCreator;
|
||||
PCProject *subproject = nil;
|
||||
NSString *subType = nil;
|
||||
|
||||
if ([projectType isEqualToString:@"Application"])
|
||||
subType = PCProjectInterfaceGorm;
|
||||
|
||||
projectCreator = [bundleManager objectForClassName:className
|
||||
bundleType:@"project"
|
||||
protocol:@protocol(ProjectType)];
|
||||
if (!(subproject = [projectCreator createProjectAt:aPath]))
|
||||
if (!(subproject = [projectCreator createProjectAt:aPath withOption:subType]))
|
||||
{
|
||||
NSRunAlertPanel(@"New Subproject",
|
||||
@"Internal error!"
|
||||
|
@ -1358,9 +1380,6 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
[subproject setSuperProject:activeProject];
|
||||
[subproject setProjectManager:self];
|
||||
|
||||
// PCLogInfo(self, @"{createSubproject} add to %@", [activeProject projectName]);
|
||||
[activeProject addSubproject:subproject];
|
||||
|
||||
return subproject;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2000-2014 Free Software Foundation
|
||||
Copyright (C) 2000-2023 Free Software Foundation
|
||||
|
||||
Authors: Philippe C.D. Robert
|
||||
Serg Stoyan
|
||||
Riccardo Mottola
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -20,7 +21,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCDefines.h>
|
||||
|
@ -260,6 +261,8 @@
|
|||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[h_split setDelegate:nil];
|
||||
[v_split setDelegate:nil];
|
||||
[projectWindow close];
|
||||
|
||||
[super dealloc];
|
||||
|
@ -658,8 +661,9 @@
|
|||
|
||||
- (void)makeKeyAndOrderFront:(id)sender
|
||||
{
|
||||
// PCLogInfo(self, @"makeKeyAndOrderFront sender: %@", [sender className]);
|
||||
[projectWindow makeKeyAndOrderFront:nil];
|
||||
// PCLogInfo(self, @"makeKeyAndOrderFront % @ sender: %@", [projectWindow title], [sender className]);
|
||||
// NSLog(@"makeKeyAndOrderFront %@ sender: %@", [projectWindow title], [sender className]);
|
||||
[projectWindow makeKeyAndOrderFront:self];
|
||||
}
|
||||
|
||||
- (void)makeKeyWindow
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <ProjectCenter/PCEditorManager.h>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import "$FILENAME$.h"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _$UCFILENAME$_H_
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import "$FILENAME$.h"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _$UCFILENAME$_H_
|
||||
|
|
35
Framework/Resources/ocppclass.template
Normal file
35
Framework/Resources/ocppclass.template
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
Project: $PROJECTNAME$
|
||||
|
||||
Copyright (C) $YEAR$ Free Software Foundation
|
||||
|
||||
Author: $FULLUSERNAME$
|
||||
|
||||
Created: $DATE$ by $USERNAME$
|
||||
|
||||
This application 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 application 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 General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import "$FILENAME$.h"
|
||||
|
||||
// This is an Obj-C++ file... add what you need to mighty Objective-C
|
||||
|
||||
// if you need, add your C++ classes
|
||||
|
||||
@implementation $FILENAME$
|
||||
|
||||
@end
|
||||
|
||||
// add your C++ methods here
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
@protocol $FILENAME$ <NSObject>
|
||||
|
|
|
@ -16,7 +16,7 @@ include $(GNUSTEP_MAKEFILES)/common.make
|
|||
#
|
||||
# Main application
|
||||
#
|
||||
VERSION = 0.6.2
|
||||
VERSION = 0.7.0
|
||||
APP_NAME = ProjectCenter
|
||||
ProjectCenter_APPLICATION_ICON = Images/ProjectCenter.tiff
|
||||
|
||||
|
@ -131,3 +131,4 @@ ProjectCenter_main.m
|
|||
include $(GNUSTEP_MAKEFILES)/aggregate.make
|
||||
include $(GNUSTEP_MAKEFILES)/application.make
|
||||
-include GNUmakefile.postamble
|
||||
include $(GNUSTEP_MAKEFILES)/Master/nsis.make
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# 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,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 31 Milk Street #960789 Boston, MA 02196 USAA.
|
||||
|
||||
before-all::
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
# 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,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 31 Milk Street #960789 Boston, MA 02196 USAA.
|
||||
|
||||
#
|
||||
# Flags dealing with compiling and linking
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCAPPCONTROLLER_H
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2001 Free Software Foundation
|
||||
Copyright (C) 2001-2021 Free Software Foundation
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCINFOCONTROLLER_H
|
||||
|
@ -28,7 +28,8 @@
|
|||
@interface PCInfoController : NSObject
|
||||
{
|
||||
id infoWindow;
|
||||
id versionField;
|
||||
IBOutlet NSTextField* versionField;
|
||||
IBOutlet NSTextField* copyrightField;
|
||||
NSDictionary *infoDict;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCMENUCONTROLLER_H
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCPREFCONTROLLER_H
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCAddFilesPanel_h_
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCBundleManager_h_
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2003-2004 Free Software Foundation
|
||||
Copyright (C) 2003-2019 Free Software Foundation
|
||||
|
||||
Authors: Serg Stoyan
|
||||
Riccardo Mottola
|
||||
|
||||
This file is part of GNUstep.
|
||||
This file is part of ProjectCenter.
|
||||
|
||||
This application is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public
|
||||
|
@ -19,13 +20,13 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCButton_h_
|
||||
#define _PCButton_h_
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <AppKit/NSButton.h>
|
||||
|
||||
/*
|
||||
* Button
|
||||
|
@ -33,14 +34,6 @@
|
|||
|
||||
@interface PCButton : NSButton
|
||||
{
|
||||
NSToolTipTag mainToolTip;
|
||||
|
||||
NSTimer *ttTimer;
|
||||
NSWindow *ttWindow;
|
||||
NSMutableDictionary *ttTitleAttrs;
|
||||
NSColor *ttBackground;
|
||||
|
||||
BOOL _hasTooltips;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCDefines_h_
|
||||
|
@ -147,6 +147,7 @@ static NSString * const PCLinkerOptions = @"LINKEROPTIONS";
|
|||
static NSString * const PCObjCCompilerOptions = @"OBJC_COMPILEROPTIONS";
|
||||
static NSString * const PCPrincipalClass = @"PRINCIPAL_CLASS";
|
||||
static NSString * const PCAuthors = @"PROJECT_AUTHORS";
|
||||
static NSString * const PCBundleIdentifier = @"BUNDLE_IDENTIFIER";
|
||||
static NSString * const PCCopyright = @"PROJECT_COPYRIGHT";
|
||||
static NSString * const PCCopyrightDescription = @"PROJECT_COPYRIGHT_DESC";
|
||||
static NSString * const PCProjectCreator = @"PROJECT_CREATOR";
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCEditorManager_h_
|
||||
|
@ -69,6 +69,7 @@
|
|||
- (NSArray *)allEditors;
|
||||
- (void)closeActiveEditor:(id)sender;
|
||||
- (void)closeEditorForFile:(NSString *)file;
|
||||
- (void)gotoFile: (NSString *)fileName atLine: (NSUInteger)line;
|
||||
|
||||
- (NSArray *)modifiedFiles;
|
||||
- (BOOL)hasModifiedFiles;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2001-2004 Free Software Foundation
|
||||
Copyright (C) 2001-2015 Free Software Foundation
|
||||
|
||||
Authors: Philippe C.D. Robert
|
||||
Serg Stoyan
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCFileCreator_h_
|
||||
|
@ -33,6 +33,7 @@
|
|||
#define ObjCHeader @"Objective-C Header"
|
||||
#define CFile @"C File"
|
||||
#define CHeader @"C Header"
|
||||
#define ObjCppClass @"Objective-C++ Class"
|
||||
#define GSMarkupFile @"GNUstep Markup"
|
||||
|
||||
@class PCProject;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCFileManager_h_
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCFileNameField_h_
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCFileNameIcon_h_
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCLOGCONTROLLER_H
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCMakefileFactory_h_
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCProject_h_
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCProjectBrowser_h_
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCProjectBuilder_h_
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCProjectBuilderPanel_h_
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCProjectEditor_h_
|
||||
|
@ -67,6 +67,9 @@
|
|||
|
||||
- (BOOL)editorProvidesBrowserItemsForItem:(NSString *)item;
|
||||
|
||||
- (id<CodeEditor>)openEditorForFilePath:(NSString *)categoryPath
|
||||
windowed:(BOOL)windowed;
|
||||
|
||||
- (id<CodeEditor>)openEditorForCategoryPath:(NSString *)categoryPath
|
||||
windowed:(BOOL)windowed;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCProjectInspector_h_
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCProjectDebugger_h_
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCLaunchPanel_h_
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCProjectLoadedFiles_h_
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCLoadedFilesPanel_h_
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCProjectManager_h_
|
||||
|
@ -164,6 +164,7 @@ extern NSString *PCActiveProjectDidChangeNotification;
|
|||
|
||||
// Also called by PCAppController
|
||||
- (void)openFileAtPath:(NSString *)filePath;
|
||||
- (void)openFileAtPath:(NSString *)filePath windowed: (BOOL)windowed;
|
||||
- (void)openFile;
|
||||
- (void)newFile;
|
||||
- (BOOL)saveFile;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCProjectWindow_h_
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCSaveModified_h_
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _ProjectCenter_h_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2008 Free Software Foundation
|
||||
Copyright (C) 2008-2016 Free Software Foundation
|
||||
|
||||
Authors: Gregory Casamento
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _CodeDebugger_h_
|
||||
|
@ -45,8 +45,8 @@
|
|||
- (void)setDebuggerWindow: (NSWindow *)window;
|
||||
- (NSView *)debuggerView;
|
||||
- (void)setDebuggerView: (id)view;
|
||||
- (NSString *)path;
|
||||
- (void)setPath:(NSString *)path;
|
||||
- (NSString *)executablePath;
|
||||
- (void)setExecutablePath:(NSString *)path;
|
||||
|
||||
// ===========================================================================
|
||||
// ==== Accessor methods
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _CodeEditor_h_
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _CodeParserProtocol_h_
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2005 Free Software Foundation
|
||||
Copyright (C) 2005-2015 Free Software Foundation
|
||||
|
||||
Authors: Serg Stoyan
|
||||
Riccardo Mottola
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -19,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PCPreferencesProtocols_h_
|
||||
|
@ -32,6 +33,9 @@
|
|||
|
||||
@protocol PCPreferences <NSObject>
|
||||
|
||||
- (NSColor *)colorFromString:(NSString *)colorString;
|
||||
- (NSString *)stringFromColor:(NSColor *)color;
|
||||
|
||||
- (NSString *)stringForKey:(NSString *)key;
|
||||
- (NSString *)stringForKey:(NSString *)key
|
||||
defaultValue:(NSString *)defaultValue;
|
||||
|
@ -44,6 +48,10 @@
|
|||
- (float)floatForKey:(NSString *)key
|
||||
defaultValue:(float)defaultValue;
|
||||
|
||||
- (NSColor *)colorForKey:(NSString *)key;
|
||||
- (NSColor *)colorForKey:(NSString *)key
|
||||
defaultValue:(NSColor *)defaultValue;
|
||||
|
||||
- (void)setString:(NSString *)stringValue
|
||||
forKey:(NSString *)aKey
|
||||
notify:(BOOL)notify;
|
||||
|
@ -53,7 +61,9 @@
|
|||
- (void)setFloat:(float)floatValue
|
||||
forKey:(NSString *)aKey
|
||||
notify:(BOOL)notify;
|
||||
|
||||
- (void)setColor:(NSColor *)color
|
||||
forKey:(NSString *)aKey
|
||||
notify:(BOOL)notify;
|
||||
@end
|
||||
|
||||
@protocol PCPrefsSection <NSObject>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2000-2002 Free Software Foundation
|
||||
Copyright (C) 2000-2017 Free Software Foundation
|
||||
|
||||
Author: Philippe C.D. Robert <probert@siggraph.org>
|
||||
Riccardo Mottola
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -19,7 +20,7 @@
|
|||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||
Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
|
||||
*/
|
||||
|
||||
#ifndef _PROJECTTYPE_H
|
||||
|
@ -29,15 +30,20 @@
|
|||
Description: A ProjectType is used to create a project of a certain type.
|
||||
With this approach this procedure can be implemented as a bundle
|
||||
and therefore PC remains open for future extensions!
|
||||
|
||||
Options are used to further customize types.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class PCProject;
|
||||
|
||||
static NSString* const PCProjectInterfaceGorm = @"GormInterface";
|
||||
static NSString* const PCProjectInterfaceRenaissance = @"RenaissanceInterface";
|
||||
|
||||
@protocol ProjectType
|
||||
|
||||
- (PCProject *)createProjectAt:(NSString *)path;
|
||||
- (PCProject *)createProjectAt:(NSString *)path withOption:(NSString *)option;
|
||||
|
||||
@end
|
||||
|
||||
|
|
101
Modules/Debuggers/ProjectCenter/GDBWrapper.h
Normal file
101
Modules/Debuggers/ProjectCenter/GDBWrapper.h
Normal file
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
** GDBWrapper
|
||||
**
|
||||
** Copyright (c) 2008-2021
|
||||
**
|
||||
** Author: Gregory Casamento <greg.casamento@gmail.com>
|
||||
** Riccardo Mottola <rm@gnu.org>
|
||||
**
|
||||
** 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., 31 Milk Street #960789 Boston, MA 02196 USA
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
#import "PCDebuggerWrapperProtocol.h"
|
||||
|
||||
typedef enum PCDebuggerOutputType_enum {
|
||||
PCDBNotFoundRecord = 0,
|
||||
PCDBPromptRecord,
|
||||
PCDBResultRecord,
|
||||
PCDBConsoleStreamRecord,
|
||||
PCDBTargetStreamRecord,
|
||||
PCDBLogStreamRecord,
|
||||
PCDBAsyncStatusRecord,
|
||||
PCDBAsyncExecRecord,
|
||||
PCDBAsyncNotifyRecord,
|
||||
PCDBBreakpointRecord,
|
||||
PCDBFrameRecord,
|
||||
PCDBThreadRecord,
|
||||
PCDBAdaExceptionRecord,
|
||||
PCDBEmptyRecord
|
||||
} PCDebuggerOutputTypes;
|
||||
|
||||
@interface GDBWrapper : NSObject <PCDebuggerWrapperProtocol>
|
||||
{
|
||||
NSString *debuggerPath;
|
||||
PCDebugger *debugger;
|
||||
NSTextView *tView;
|
||||
NSMutableString *singleInputLine;
|
||||
NSTask *task;
|
||||
NSFileHandle *stdinHandle;
|
||||
NSFileHandle *stdoutHandle;
|
||||
NSFileHandle *errorHandle;
|
||||
|
||||
NSColor *userInputColor;
|
||||
NSColor *debuggerColor;
|
||||
NSColor *messageColor;
|
||||
NSColor *errorColor;
|
||||
NSColor *promptColor;
|
||||
NSFont *font;
|
||||
|
||||
BOOL debuggerStarted;
|
||||
float debuggerVersion;
|
||||
NSDictionary *lastMIDictionary;
|
||||
NSString *lastMIString;
|
||||
}
|
||||
|
||||
- (float) debuggerVersion;
|
||||
- (void) setDebuggerVersion:(float)ver;
|
||||
|
||||
- (void)logStdOut:(NSNotification *)aNotif;
|
||||
|
||||
- (void)logErrOut:(NSNotification *)aNotif;
|
||||
|
||||
- (void) taskDidTerminate: (NSNotification *)notif;
|
||||
|
||||
- (NSString *) startMessage;
|
||||
|
||||
- (NSString *) stopMessage;
|
||||
|
||||
- (void) putChar:(unichar)ch;
|
||||
|
||||
// methods for a look-ahead recursive parser which attempts to parse
|
||||
// gdb's output to a Dictionary/Array structure representable in a plist
|
||||
|
||||
// LAR parser - single string element (-> NSString value)
|
||||
- (NSString *) parseString: (NSScanner *)scanner;
|
||||
|
||||
// LAR parser - array element (-> NSArray value)
|
||||
- (NSArray *) parseArray: (NSScanner *)scanner;
|
||||
|
||||
// LAR parser - key-value list (-> NSDictionary value)
|
||||
- (NSDictionary *) parseKeyValue: (NSScanner *)scanner;
|
||||
|
||||
// parses a single line from the debugger or the machine interface
|
||||
// it splits out the type then recurses in the LAR methods
|
||||
- (PCDebuggerOutputTypes) parseStringLine: (NSString *)stringInput;
|
||||
|
||||
@end
|
1008
Modules/Debuggers/ProjectCenter/GDBWrapper.m
Normal file
1008
Modules/Debuggers/ProjectCenter/GDBWrapper.m
Normal file
File diff suppressed because it is too large
Load diff
|
@ -37,8 +37,9 @@ ProjectCenter_RESOURCE_FILES= \
|
|||
#
|
||||
ProjectCenter_HEADERS= \
|
||||
PCDebugger.h \
|
||||
PCDebugggerView.h \
|
||||
PTYView.h
|
||||
PCDebuggerView.h \
|
||||
PCDebuggerWrapperProtocol.h \
|
||||
GDBWrapper.h
|
||||
|
||||
#
|
||||
# Class files
|
||||
|
@ -46,10 +47,10 @@ ProjectCenter_HEADERS= \
|
|||
ProjectCenter_OBJC_FILES= \
|
||||
PCDebugger.m \
|
||||
PCDebuggerView.m \
|
||||
PTYView.m
|
||||
GDBWrapper.m
|
||||
|
||||
|
||||
ADDITIONAL_NATIVE_LIBS += util
|
||||
#ADDITIONAL_OBJC_LIBS=
|
||||
|
||||
include ../../GNUmakefile.bundles
|
||||
include $(GNUSTEP_MAKEFILES)/bundle.make
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
/*
|
||||
** PCDebugger
|
||||
**
|
||||
** Copyright (c) 2008
|
||||
** Copyright (c) 2008-2021
|
||||
**
|
||||
** Author: Gregory Casamento <greg_casamento@yahoo.com>
|
||||
** Riccardo Mottola <rm@gnu.org>
|
||||
**
|
||||
** 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
|
||||
|
@ -17,7 +18,7 @@
|
|||
**
|
||||
** 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
|
||||
** Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA
|
||||
*/
|
||||
|
||||
#import <stdio.h>
|
||||
|
@ -26,16 +27,45 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <Protocols/CodeDebugger.h>
|
||||
#import "PCDebuggerWrapperProtocol.h"
|
||||
|
||||
extern NSString *PCBreakTypeKey;
|
||||
extern NSString *PCBreakTypeByLine;
|
||||
extern NSString *PCBreakTypeMethod;
|
||||
extern NSString *PCBreakMethod;
|
||||
extern NSString *PCBreakFilename;
|
||||
extern NSString *PCBreakLineNumber;
|
||||
|
||||
extern NSString *PCDBDebuggerStartedNotification;
|
||||
|
||||
@interface PCDebugger : NSObject <CodeDebugger>
|
||||
{
|
||||
id debuggerView;
|
||||
id debuggerWindow;
|
||||
id statusField;
|
||||
NSString *path;
|
||||
NSString *debuggerPath;
|
||||
NSString *executablePath;
|
||||
int subProcessId;
|
||||
NSDictionary *lastInfoParsed;
|
||||
NSString *lastFileNameParsed;
|
||||
NSUInteger lastLineNumberParsed;
|
||||
NSMutableArray *breakpoints;
|
||||
id <PCDebuggerWrapperProtocol> debuggerWrapper;
|
||||
}
|
||||
|
||||
- (id <PCDebuggerWrapperProtocol>)debuggerWrapper;
|
||||
- (void) setStatus: (NSString *) status;
|
||||
- (NSString *) status;
|
||||
- (NSString *)executablePath;
|
||||
- (void)setExecutablePath:(NSString *)p;
|
||||
- (void) interrupt;
|
||||
- (int) subProcessId;
|
||||
- (void) setSubProcessId:(int)pid;
|
||||
- (NSDictionary *)lastInfoParsed;
|
||||
- (void)setSetInfoParsed: (NSDictionary *)dict;
|
||||
- (NSString *)lastFileNameParsed;
|
||||
- (void) setLastFileNameParsed: (NSString *)fname;
|
||||
- (NSUInteger)lastLineNumberParsed;
|
||||
- (void)setLastLineNumberParsed: (NSUInteger)num;
|
||||
- (void)updateEditor;
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
/*
|
||||
** PCDebugger
|
||||
** PCDebugger.m
|
||||
**
|
||||
** Copyright (c) 2008
|
||||
** Copyright (c) 2008-2021
|
||||
**
|
||||
** Author: Gregory Casamento <greg_casamento@yahoo.com>
|
||||
** Author: Gregory Casamento <greg.casamento@gmail.com>
|
||||
** Riccardo Mottola <rm@gnu.org>>
|
||||
**
|
||||
** 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
|
||||
|
@ -17,13 +18,30 @@
|
|||
**
|
||||
** 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
|
||||
** Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA
|
||||
*/
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0501 // Minimal target is Windows XP
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#endif
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import "PCDebugger.h"
|
||||
#import "PCDebuggerView.h"
|
||||
|
||||
#import <ProjectCenter/PCProjectManager.h>
|
||||
#import <ProjectCenter/PCEditorManager.h>
|
||||
#import "PCAppController.h"
|
||||
|
||||
#import "Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h"
|
||||
#import "PCDebuggerWrapperProtocol.h"
|
||||
#import "GDBWrapper.h"
|
||||
|
||||
|
||||
#ifndef NOTIFICATION_CENTER
|
||||
#define NOTIFICATION_CENTER [NSNotificationCenter defaultCenter]
|
||||
#endif
|
||||
|
@ -38,6 +56,14 @@ static NSImage *stepOutImage = nil;
|
|||
static NSImage *upImage = nil;
|
||||
static NSImage *downImage = nil;
|
||||
|
||||
NSString *PCBreakTypeKey = @"BreakType";
|
||||
NSString *PCBreakTypeByLine = @"BreakTypeLine";
|
||||
NSString *PCBreakTypeMethod = @"BreakTypeMethod";
|
||||
NSString *PCBreakMethod = @"BreakMethod";
|
||||
NSString *PCBreakFilename = @"BreakFilename";
|
||||
NSString *PCBreakLineNumber = @"BreakLineNumber";
|
||||
NSString *PCDBDebuggerStartedNotification = @"PCDBDebuggerStartedNotification";
|
||||
|
||||
@implementation PCDebugger
|
||||
+ (void) initialize
|
||||
{
|
||||
|
@ -95,10 +121,29 @@ static NSImage *downImage = nil;
|
|||
}
|
||||
}
|
||||
|
||||
- (NSFont *)consoleFont
|
||||
{
|
||||
NSUserDefaults *defs;
|
||||
NSString *fontName;
|
||||
CGFloat fontSize;
|
||||
NSFont *font = nil;
|
||||
|
||||
defs = [NSUserDefaults standardUserDefaults];
|
||||
fontName = [defs stringForKey:ConsoleFixedFont];
|
||||
fontSize = [defs floatForKey:ConsoleFixedFontSize];
|
||||
|
||||
font = [NSFont fontWithName:fontName size:fontSize];
|
||||
if (font == nil)
|
||||
font = [NSFont userFixedPitchFontOfSize:0];
|
||||
|
||||
return font;
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
if((self = [super init]) != nil)
|
||||
{
|
||||
NSLog(@"PCDebugger Init");
|
||||
// initialization here...
|
||||
if([NSBundle loadNibNamed: @"PCDebugger" owner: self] == NO)
|
||||
{
|
||||
|
@ -106,6 +151,22 @@ static NSImage *downImage = nil;
|
|||
}
|
||||
|
||||
[(PCDebuggerView *)debuggerView setDebugger:self];
|
||||
debuggerWrapper = [[GDBWrapper alloc] init];
|
||||
[debuggerWrapper setTextView:debuggerView];
|
||||
[debuggerWrapper setDebugger:self];
|
||||
[debuggerView setFont: [self consoleFont]];
|
||||
|
||||
subProcessId = 0;
|
||||
lastInfoParsed = nil;
|
||||
lastFileNameParsed = nil;
|
||||
lastLineNumberParsed = NSNotFound;
|
||||
|
||||
breakpoints = nil;
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver: self
|
||||
selector: @selector(handleNotification:)
|
||||
name: PCDBDebuggerStartedNotification
|
||||
object: nil];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -113,8 +174,8 @@ static NSImage *downImage = nil;
|
|||
-(void) debugExecutableAtPath: (NSString *)filePath
|
||||
withDebugger: (NSString *)debugger
|
||||
{
|
||||
ASSIGN(path,filePath);
|
||||
ASSIGN(debuggerPath,debugger);
|
||||
ASSIGN(executablePath,filePath);
|
||||
[debuggerWrapper setDebuggerPath: debugger];
|
||||
[debuggerWindow setTitle: [NSString stringWithFormat: @"Debugger (%@)",filePath]];
|
||||
[self show];
|
||||
}
|
||||
|
@ -122,16 +183,44 @@ static NSImage *downImage = nil;
|
|||
- (void) show
|
||||
{
|
||||
[debuggerWindow makeKeyAndOrderFront: self];
|
||||
[self startDebugger];
|
||||
if (![debuggerWrapper debuggerStarted])
|
||||
[self startDebugger];
|
||||
}
|
||||
|
||||
- (void) startDebugger
|
||||
{
|
||||
[debuggerView runProgram: debuggerPath
|
||||
inCurrentDirectory: [path stringByDeletingLastPathComponent]
|
||||
withArguments: [[NSArray alloc] initWithObjects: @"-f", path, nil]
|
||||
[debuggerView runProgram: executablePath
|
||||
inCurrentDirectory: [executablePath stringByDeletingLastPathComponent]
|
||||
logStandardError: YES];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void) initBreakpoints
|
||||
{
|
||||
breakpoints = [[NSMutableArray alloc] init];
|
||||
/* CRUDE EXAMPLES * TODO FIXME *
|
||||
NSDictionary *dP;
|
||||
NSLog(@"initing breakpoints");
|
||||
|
||||
dP = [NSDictionary dictionaryWithObjectsAndKeys: PCBreakTypeMethod, PCBreakTypeKey, @"[NSException raise]", PCBreakMethod, nil];
|
||||
// [breakpoints addObject:dP];
|
||||
dP = [NSDictionary dictionaryWithObjectsAndKeys: PCBreakTypeByLine, PCBreakTypeKey, @"AppController.m", PCBreakFilename, [NSNumber numberWithInt:100], PCBreakLineNumber, nil];
|
||||
[breakpoints addObject:dP];
|
||||
*/
|
||||
[debuggerWrapper setBreakpoints:breakpoints];
|
||||
}
|
||||
|
||||
- (void) debuggerSetup
|
||||
{
|
||||
[debuggerWrapper debuggerSetup];
|
||||
}
|
||||
|
||||
- (void) handleNotification: (NSNotification *)notification
|
||||
{
|
||||
[self initBreakpoints];
|
||||
[self debuggerSetup];
|
||||
}
|
||||
|
||||
|
||||
- (void) awakeFromNib
|
||||
{
|
||||
|
@ -141,11 +230,15 @@ static NSImage *downImage = nil;
|
|||
[debuggerWindow setToolbar: toolbar];
|
||||
RELEASE(toolbar);
|
||||
|
||||
[debuggerView setFont: [NSFont userFixedPitchFontOfSize: 0]];
|
||||
[debuggerWindow setFrameAutosaveName: @"PCDebuggerWindow"];
|
||||
[self setStatus: @"Idle."];
|
||||
}
|
||||
|
||||
- (id <PCDebuggerWrapperProtocol>)debuggerWrapper
|
||||
{
|
||||
return debuggerWrapper;
|
||||
}
|
||||
|
||||
- (NSWindow *)debuggerWindow
|
||||
{
|
||||
return debuggerWindow;
|
||||
|
@ -166,70 +259,146 @@ static NSImage *downImage = nil;
|
|||
debuggerView = view;
|
||||
}
|
||||
|
||||
- (NSString *)path
|
||||
- (NSString *)executablePath
|
||||
{
|
||||
return path;
|
||||
return executablePath;
|
||||
}
|
||||
|
||||
- (void)setPath:(NSString *)p
|
||||
- (void)setExecutablePath:(NSString *)p
|
||||
{
|
||||
ASSIGN(path,p);
|
||||
ASSIGN(executablePath,p);
|
||||
}
|
||||
|
||||
- (int) subProcessId
|
||||
{
|
||||
return subProcessId;
|
||||
}
|
||||
|
||||
- (void) setSubProcessId: (int)pid
|
||||
{
|
||||
NSLog(@"PCDebugger setSubProcessId: %d", pid);
|
||||
subProcessId = pid;
|
||||
}
|
||||
|
||||
- (NSDictionary *)lastInfoParsed
|
||||
{
|
||||
return lastInfoParsed;
|
||||
}
|
||||
|
||||
- (void)setSetInfoParsed: (NSDictionary *)dict
|
||||
{
|
||||
lastInfoParsed = dict;
|
||||
}
|
||||
|
||||
- (NSString *)lastFileNameParsed
|
||||
{
|
||||
return lastFileNameParsed;
|
||||
}
|
||||
|
||||
- (void) setLastFileNameParsed: (NSString *)fname
|
||||
{
|
||||
lastFileNameParsed = fname;
|
||||
}
|
||||
|
||||
- (NSUInteger)lastLineNumberParsed
|
||||
{
|
||||
return lastLineNumberParsed;
|
||||
}
|
||||
|
||||
- (void)setLastLineNumberParsed: (NSUInteger)num
|
||||
{
|
||||
lastLineNumberParsed = num;
|
||||
}
|
||||
|
||||
- (void) updateEditor
|
||||
{
|
||||
PCAppController *controller = (PCAppController *)[NSApp delegate];
|
||||
PCProjectManager *pm = [controller projectManager];
|
||||
PCEditorManager *em = [pm editorManager];
|
||||
[em gotoFile: lastFileNameParsed
|
||||
atLine: lastLineNumberParsed];
|
||||
}
|
||||
|
||||
// kill process
|
||||
- (void) interrupt
|
||||
{
|
||||
if(subProcessId != 0)
|
||||
{
|
||||
#ifndef __MINGW32__
|
||||
kill(subProcessId,SIGINT);
|
||||
#else
|
||||
HANDLE proc;
|
||||
|
||||
proc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)subProcessId);
|
||||
if (proc == NULL)
|
||||
{
|
||||
DWORD lastError = GetLastError();
|
||||
NSLog(@"error opening process %lu", (unsigned long)lastError);
|
||||
return;
|
||||
}
|
||||
if (DebugBreakProcess(proc))
|
||||
{
|
||||
DWORD lastError = GetLastError();
|
||||
NSLog(@"error sending break %lu", (unsigned long)lastError);
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"break sent successfully");
|
||||
}
|
||||
CloseHandle(proc);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// action methods for toolbar...
|
||||
- (void) go: (id) sender
|
||||
{
|
||||
[self setStatus: @"Running..."];
|
||||
/* each run makes a new PID but we parse it only if non-zero */
|
||||
[self setSubProcessId:0];
|
||||
[debuggerView putString: @"run\n"];
|
||||
}
|
||||
|
||||
- (void) pause: (id) sender
|
||||
{
|
||||
[self setStatus: @"Stopped."];
|
||||
[debuggerView interrupt];
|
||||
[self interrupt];
|
||||
}
|
||||
|
||||
- (void) continue: (id) sender
|
||||
{
|
||||
[self setStatus: @"Continue..."];
|
||||
[debuggerView putString: @"continue\n"];
|
||||
}
|
||||
|
||||
- (void) restart: (id) sender
|
||||
{
|
||||
[self setStatus: @"Restarting..."];
|
||||
[debuggerView interrupt];
|
||||
[self interrupt];
|
||||
/* each run makes a new PID but we parse it only if non-zero */
|
||||
[self setSubProcessId:0];
|
||||
[debuggerView putString: @"run\n"];
|
||||
[self setStatus: @"Running..."];
|
||||
}
|
||||
|
||||
- (void) next: (id) sender
|
||||
{
|
||||
[self setStatus: @"Going to next line."];
|
||||
[debuggerView putString: @"next\n"];
|
||||
}
|
||||
|
||||
- (void) stepInto: (id) sender
|
||||
{
|
||||
[self setStatus: @"Stepping into method."];
|
||||
[debuggerView putString: @"step\n"];
|
||||
}
|
||||
|
||||
- (void) stepOut: (id) sender
|
||||
{
|
||||
[self setStatus: @"Finishing method."];
|
||||
[debuggerView putString: @"finish\n"];
|
||||
}
|
||||
|
||||
- (void) up: (id) sender
|
||||
{
|
||||
[self setStatus: @"Up to calling method."];
|
||||
[debuggerView putString: @"up\n"];
|
||||
}
|
||||
|
||||
- (void) down: (id) sender
|
||||
{
|
||||
[self setStatus: @"Down to called method."];
|
||||
[debuggerView putString: @"down\n"];
|
||||
}
|
||||
|
||||
|
@ -246,7 +415,8 @@ static NSImage *downImage = nil;
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
[debuggerWindow close];
|
||||
[debuggerWrapper release];
|
||||
[breakpoints release];
|
||||
[super dealloc];
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
/*
|
||||
** PCDebuggerView
|
||||
**
|
||||
** Copyright (c) 2008
|
||||
** Copyright (c) 2008-2021
|
||||
**
|
||||
** Author: Gregory Casamento <greg_casamento@yahoo.com>
|
||||
** Author: Gregory Casamento <greg.casamento@gmail.com>
|
||||
** Riccardo Mottola <rm@gnu.org>
|
||||
**
|
||||
** 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
|
||||
|
@ -17,23 +18,29 @@
|
|||
**
|
||||
** 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
|
||||
** Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA
|
||||
*/
|
||||
|
||||
#import "PTYView.h"
|
||||
#import <Foundation/NSString.h>
|
||||
#import <AppKit/NSTextView.h>
|
||||
|
||||
|
||||
@class PCDebugger;
|
||||
@class NSString;
|
||||
|
||||
@interface PCDebuggerView : PTYView
|
||||
@interface PCDebuggerView : NSTextView
|
||||
{
|
||||
PCDebugger *debugger;
|
||||
NSString *currentFile;
|
||||
int subProcessId;
|
||||
}
|
||||
|
||||
- (void) setDebugger:(PCDebugger *)theDebugger;
|
||||
- (void) setCurrentFile: (NSString *)fileName;
|
||||
- (NSString *) currentFile;
|
||||
- (int) subProcessId;
|
||||
- (void)setFont:(NSFont *)font;
|
||||
|
||||
|
||||
|
||||
- (void) runProgram: (NSString *)path
|
||||
inCurrentDirectory: (NSString *)directory
|
||||
logStandardError: (BOOL)logError;
|
||||
|
||||
- (void) putString: (NSString *)string;
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
/*
|
||||
** PCDebuggerView
|
||||
**
|
||||
** Copyright (c) 2008
|
||||
** Copyright (c) 2008-2021
|
||||
**
|
||||
** Author: Gregory Casamento <greg_casamento@yahoo.com>
|
||||
** Author: Gregory Casamento <greg.casamento@gmail.com>
|
||||
** Riccardo Mottola <rm@gnu.org>
|
||||
**
|
||||
** 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
|
||||
|
@ -17,7 +18,7 @@
|
|||
**
|
||||
** 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
|
||||
** Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA
|
||||
*/
|
||||
|
||||
#import "PCDebuggerView.h"
|
||||
|
@ -40,179 +41,55 @@
|
|||
debugger = theDebugger;
|
||||
}
|
||||
|
||||
|
||||
- (void)setFont:(NSFont *)aFont
|
||||
{
|
||||
[[debugger debuggerWrapper] setFont:aFont];
|
||||
}
|
||||
|
||||
/**
|
||||
* Log string to the view.
|
||||
*/
|
||||
- (void) logString:(NSString *)str
|
||||
newLine:(BOOL)newLine
|
||||
{
|
||||
NSRange range;
|
||||
BOOL printLine = YES;
|
||||
|
||||
range = [str rangeOfString: @"\032\032"]; // Breakpoint"];
|
||||
if (range.location != NSNotFound)
|
||||
{
|
||||
NSScanner *scanner = [NSScanner scannerWithString: str];
|
||||
NSCharacterSet *empty = [NSCharacterSet characterSetWithCharactersInString: @""];
|
||||
NSString *file = nil;
|
||||
NSString *line = nil;
|
||||
NSString *bytes = nil;
|
||||
int l = 0, b = 0;
|
||||
|
||||
[scanner setCharactersToBeSkipped: empty];
|
||||
[scanner scanUpToString: @"\032\032" intoString: NULL];
|
||||
[scanner scanString: @"\032\032" intoString: NULL];
|
||||
[scanner scanUpToString: @":" intoString: &file];
|
||||
[scanner scanString: @":" intoString: NULL];
|
||||
[scanner scanUpToString: @":" intoString: &line];
|
||||
if (line != nil)
|
||||
{
|
||||
l = [line intValue];
|
||||
[scanner scanString: @":" intoString: NULL];
|
||||
[scanner scanUpToString: @":" intoString: &bytes];
|
||||
|
||||
if (bytes != nil)
|
||||
{
|
||||
b = [bytes intValue];
|
||||
if (l != 0 && b != 0) // if the line & bytes are parsable, then send the notification.
|
||||
{
|
||||
NSDictionary *dict = [NSDictionary
|
||||
dictionaryWithObjectsAndKeys:
|
||||
file, @"file", line, @"line", nil];
|
||||
NSString *statusString = [NSString stringWithFormat: @"Stopped, %@:%@",file,line];
|
||||
|
||||
[debugger setStatus: statusString];
|
||||
[NOTIFICATION_CENTER
|
||||
postNotificationName: PCProjectBreakpointNotification
|
||||
object: dict];
|
||||
[[self window] makeKeyAndOrderFront: self];
|
||||
printLine = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: This works on certain versions of gdb, but we need to come up with another way of getting
|
||||
// the process id in a more generic way.
|
||||
range = [str rangeOfString: @"[New Thread"];
|
||||
if (range.location != NSNotFound)
|
||||
{
|
||||
NSScanner *scanner = [NSScanner scannerWithString: str];
|
||||
NSString *process = nil;
|
||||
|
||||
[scanner scanUpToString: @"(LWP" intoString: NULL];
|
||||
[scanner scanString: @"(LWP" intoString: NULL];
|
||||
[scanner scanUpToString: @")" intoString: &process];
|
||||
subProcessId = [process intValue];
|
||||
}
|
||||
|
||||
// Check certain status messages from GDB and set the state correctly.
|
||||
range = [str rangeOfString: @"Starting program:"];
|
||||
if (range.location != NSNotFound)
|
||||
{
|
||||
[debugger setStatus: @"Running..."];
|
||||
}
|
||||
|
||||
// Check certain status messages from GDB and set the state correctly.
|
||||
range = [str rangeOfString: @"Program received signal"];
|
||||
if (range.location != NSNotFound)
|
||||
{
|
||||
[debugger setStatus: @"Stopped"];
|
||||
}
|
||||
|
||||
// Check certain status messages from GDB and set the state correctly.
|
||||
range = [str rangeOfString: @"Terminated"];
|
||||
if (range.location != NSNotFound)
|
||||
{
|
||||
[debugger setStatus: @"Terminated"];
|
||||
}
|
||||
|
||||
// Check certain status messages from GDB and set the state correctly.
|
||||
range = [str rangeOfString: @"Program exited"];
|
||||
if (range.location != NSNotFound)
|
||||
{
|
||||
[debugger setStatus: @"Terminated"];
|
||||
}
|
||||
|
||||
// FIXME: Filter this error, until we find a better way to deal with it.
|
||||
range = [str rangeOfString: @"[tcsetpgrp failed in terminal_inferior:"];
|
||||
if (range.location != NSNotFound)
|
||||
{
|
||||
printLine = NO;
|
||||
}
|
||||
|
||||
// if the line is not filtered, print it...
|
||||
if(printLine)
|
||||
{
|
||||
[super logString: str newLine: newLine];
|
||||
}
|
||||
[[debugger debuggerWrapper] logString: str newLine: newLine withColor:[[debugger debuggerWrapper] debuggerColor]];
|
||||
}
|
||||
|
||||
- (void) setCurrentFile: (NSString *)fileName
|
||||
{
|
||||
ASSIGN(currentFile,fileName);
|
||||
}
|
||||
|
||||
- (NSString *) currentFile
|
||||
{
|
||||
return currentFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* lookup the process id.
|
||||
*/
|
||||
/*
|
||||
- (int) subProcessId
|
||||
{
|
||||
int task_pid = [task processIdentifier];
|
||||
int child_pid = 0;
|
||||
NSArray *entries = [[NSFileManager defaultManager] directoryContentsAtPath: @"/proc"];
|
||||
NSEnumerator *en = [entries objectEnumerator];
|
||||
NSString *entry = nil;
|
||||
|
||||
// FIXME: I'm looking for a generic way to do this, what we have here is very /proc specific.
|
||||
// which I don't like since it ties this functionality to systems which have /proc.
|
||||
while((entry = [en nextObject]) != nil)
|
||||
{
|
||||
int pid = [entry intValue];
|
||||
if (pid != 0)
|
||||
{
|
||||
int ppid = getppid(pid);
|
||||
if (ppid == task_pid)
|
||||
{
|
||||
child_pid = pid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return child_pid;
|
||||
}
|
||||
*/
|
||||
|
||||
- (int) subProcessId
|
||||
{
|
||||
return subProcessId;
|
||||
}
|
||||
|
||||
- (void) interrupt
|
||||
{
|
||||
int pid = [self subProcessId];
|
||||
if(pid != 0)
|
||||
{
|
||||
#ifndef __MINGW32__
|
||||
kill(pid,SIGINT);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
- (void) terminate
|
||||
{
|
||||
[super terminate];
|
||||
[[debugger debuggerWrapper] terminate];
|
||||
}
|
||||
|
||||
- (void) mouseDown: (NSEvent *)event
|
||||
{
|
||||
// do nothing...
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the program.
|
||||
*/
|
||||
- (void) runProgram: (NSString *)path
|
||||
inCurrentDirectory: (NSString *)directory
|
||||
logStandardError: (BOOL)logError
|
||||
{
|
||||
[[debugger debuggerWrapper] runProgram: path
|
||||
inCurrentDirectory: directory
|
||||
logStandardError: logError];
|
||||
}
|
||||
|
||||
- (void) putString: (NSString *)string
|
||||
{
|
||||
NSAttributedString* attr = [[NSAttributedString alloc] initWithString:string];
|
||||
[[self textStorage] appendAttributedString:attr];
|
||||
[self scrollRangeToVisible:NSMakeRange([[self string] length], 0)];
|
||||
[[debugger debuggerWrapper] putString:string];
|
||||
}
|
||||
|
||||
- (void) keyDown: (NSEvent*)theEvent
|
||||
{
|
||||
[[debugger debuggerWrapper] keyDown:theEvent];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
** PTYView
|
||||
** PCDebuggerWrapperProtocol.h
|
||||
**
|
||||
** Copyright (c) 2008
|
||||
** Copyright (c) 2016-2021
|
||||
**
|
||||
** Author: Gregory Casamento <greg_casamento@yahoo.com>
|
||||
** Author: Riccardo Mottola <rm@gnu.org>
|
||||
**
|
||||
** 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
|
||||
|
@ -17,48 +17,54 @@
|
|||
**
|
||||
** 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
|
||||
** Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
@interface PTYView : NSTextView
|
||||
{
|
||||
NSTask *task;
|
||||
NSFileHandle *master_handle;
|
||||
NSFileHandle *slave_handle;
|
||||
NSFileHandle *error_handle;
|
||||
int master_fd, slave_fd;
|
||||
}
|
||||
@class NSColor;
|
||||
@class NSTextView;
|
||||
@class NSArray;
|
||||
@class NSString;
|
||||
@class PCDebugger;
|
||||
|
||||
- (int)openpty;
|
||||
@protocol PCDebuggerWrapperProtocol <NSObject>
|
||||
|
||||
- (void)logString:(NSString *)str
|
||||
newLine:(BOOL)newLine;
|
||||
- (void)setFont:(NSFont *)font;
|
||||
|
||||
- (void)logData:(NSData *)data;
|
||||
- (NSColor *)userInputColor;
|
||||
- (NSColor *)debuggerColor;
|
||||
- (NSColor *)messageColor;
|
||||
- (NSColor *)errorColor;
|
||||
|
||||
- (void)logStdOut:(NSNotification *)aNotif;
|
||||
- (NSTextView *)textView;
|
||||
- (void)setTextView: (NSTextView *)tv;
|
||||
- (PCDebugger *)debugger;
|
||||
- (void)setDebugger:(PCDebugger *)dbg;
|
||||
|
||||
- (void)logErrOut:(NSNotification *)aNotif;
|
||||
- (NSString *)debuggerPath;
|
||||
- (void)setDebuggerPath:(NSString *)path;
|
||||
|
||||
- (void) taskDidTerminate: (NSNotification *)notif;
|
||||
|
||||
- (NSString *) startMessage;
|
||||
|
||||
- (NSString *) stopMessage;
|
||||
- (BOOL)debuggerStarted;
|
||||
|
||||
- (void) runProgram: (NSString *)path
|
||||
inCurrentDirectory: (NSString *)directory
|
||||
withArguments: (NSArray *)array
|
||||
logStandardError: (BOOL)logError;
|
||||
|
||||
- (void)logString:(NSString *)str
|
||||
newLine:(BOOL)newLine
|
||||
withColor:(NSColor *)color;
|
||||
|
||||
- (void) setBreakpoints:(NSArray *)breakpoints;
|
||||
|
||||
- (void) terminate;
|
||||
|
||||
- (void) interrupt;
|
||||
|
||||
- (void) putString: (NSString *)string;
|
||||
|
||||
- (void) putChar:(unichar)ch;
|
||||
- (void) keyDown: (NSEvent*)theEvent;
|
||||
|
||||
- (void) debuggerSetup;
|
||||
|
||||
@end
|
|
@ -1,417 +0,0 @@
|
|||
/*
|
||||
** PTYView
|
||||
**
|
||||
** Copyright (c) 2008-2012 Free Software Foundation
|
||||
**
|
||||
** Author: Gregory Casamento <greg_casamento@yahoo.com>
|
||||
**
|
||||
** 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
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <stdio.h> /* for stderr and perror*/
|
||||
#include <errno.h> /* for int errno */
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined (__FreeBSD__)
|
||||
#include <sys/ioctl.h>
|
||||
#include <termios.h>
|
||||
#include <libutil.h>
|
||||
#elif defined (__OpenBSD__)
|
||||
#include <termios.h>
|
||||
#include <util.h>
|
||||
#else
|
||||
#include <sys/termios.h>
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#ifndef NOTIFICATION_CENTER
|
||||
#define NOTIFICATION_CENTER [NSNotificationCenter defaultCenter]
|
||||
#endif
|
||||
|
||||
/* check for solaris */
|
||||
#if defined (__SVR4) && defined (__sun)
|
||||
#define __SOLARIS__ 1
|
||||
#define USE_FORKPTY_REPLACEMENT 1
|
||||
#endif
|
||||
|
||||
#if defined(__SOLARIS__)
|
||||
#include <stropts.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if !(defined (__NetBSD__)) && !(defined (__SOLARIS__)) && !(defined (__OpenBSD__)) && !(defined(__FreeBSD__))
|
||||
# include <pty.h>
|
||||
#endif
|
||||
|
||||
#import "PTYView.h"
|
||||
|
||||
#ifdef USE_FORKPTY_REPLACEMENT
|
||||
int openpty(int *amaster, int *aslave, char *name, const struct termios *termp, const struct winsize *winp)
|
||||
{
|
||||
int fdm, fds;
|
||||
char *slaveName;
|
||||
|
||||
fdm = open("/dev/ptmx", O_RDWR); /* open master */
|
||||
if (fdm == -1)
|
||||
{
|
||||
perror("openpty:open(master)");
|
||||
return -1;
|
||||
}
|
||||
if(grantpt(fdm)) /* grant access to the slave */
|
||||
{
|
||||
perror("openpty:grantpt(master)");
|
||||
close(fdm);
|
||||
return -1;
|
||||
}
|
||||
if(unlockpt(fdm)) /* unlock the slave terminal */
|
||||
{
|
||||
perror("openpty:unlockpt(master)");
|
||||
close(fdm);
|
||||
return -1;
|
||||
}
|
||||
|
||||
slaveName = ptsname(fdm); /* get name of the slave */
|
||||
if (slaveName == NULL)
|
||||
{
|
||||
perror("openpty:ptsname(master)");
|
||||
close(fdm);
|
||||
return -1;
|
||||
}
|
||||
if (name) /* of name ptr not null, copy it name back */
|
||||
strcpy(name, slaveName);
|
||||
|
||||
fds = open(slaveName, O_RDWR | O_NOCTTY); /* open slave */
|
||||
if (fds == -1)
|
||||
{
|
||||
perror("openpty:open(slave)");
|
||||
close (fdm);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ldterm and ttcompat are automatically pushed on the stack on some systems*/
|
||||
#ifdef __SOLARIS__
|
||||
if (ioctl(fds, I_PUSH, "ptem") == -1) /* pseudo terminal module */
|
||||
{
|
||||
perror("openpty:ioctl(I_PUSH, ptem");
|
||||
close(fdm);
|
||||
close(fds);
|
||||
return -1;
|
||||
}
|
||||
if (ioctl(fds, I_PUSH, "ldterm") == -1) /* ldterm must stay atop ptem */
|
||||
{
|
||||
perror("forkpty:ioctl(I_PUSH, ldterm");
|
||||
close(fdm);
|
||||
close(fds);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* set terminal parameters if present */
|
||||
// if (termp)
|
||||
// ioctl(fds, TCSETS, termp);
|
||||
//if (winp)
|
||||
// ioctl(fds, TIOCSWINSZ, winp);
|
||||
|
||||
*amaster = fdm;
|
||||
*aslave = fds;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@implementation PTYView
|
||||
/**
|
||||
* Creates master device.
|
||||
*/
|
||||
- (int) openpty
|
||||
{
|
||||
if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) == -1)
|
||||
{
|
||||
NSLog(@"Call to openpty(...) failed.");
|
||||
}
|
||||
return master_fd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log string to the view.
|
||||
*/
|
||||
- (void) logString:(NSString *)str
|
||||
newLine:(BOOL)newLine
|
||||
{
|
||||
NSRange range;
|
||||
|
||||
[self replaceCharactersInRange:
|
||||
NSMakeRange([[self string] length],0) withString:str];
|
||||
|
||||
if (newLine)
|
||||
{
|
||||
[self replaceCharactersInRange:
|
||||
NSMakeRange([[self string] length], 0) withString:@"\n"];
|
||||
}
|
||||
|
||||
//
|
||||
// Is it backspace? If so, remove one character from the terminal to reflect
|
||||
// the deletion. For some reason backspace sends multiple characters, so I have to remove
|
||||
// one more character than what is sent in order to appropriately delete from the buffer.
|
||||
//
|
||||
range = [str rangeOfString: @"\b"];
|
||||
if (range.location != NSNotFound)
|
||||
{
|
||||
NSString *newString = [[self string] substringToIndex: [[self string] length] - 4];
|
||||
[self setString: newString];
|
||||
}
|
||||
|
||||
[self scrollRangeToVisible:NSMakeRange([[self string] length], 0)];
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
/**
|
||||
* Log data.
|
||||
*/
|
||||
- (void) logData:(NSData *)data
|
||||
{
|
||||
NSString *dataString;
|
||||
dataString = [[NSString alloc]
|
||||
initWithData:data
|
||||
encoding:[NSString defaultCStringEncoding]];
|
||||
[self logString: dataString newLine: NO];
|
||||
RELEASE(dataString);
|
||||
}
|
||||
|
||||
/**
|
||||
* Log standard out.
|
||||
*/
|
||||
- (void) logStdOut:(NSNotification *)aNotif
|
||||
{
|
||||
NSData *data;
|
||||
NSFileHandle *handle = master_handle;
|
||||
|
||||
if ((data = [handle availableData]) && [data length] > 0)
|
||||
{
|
||||
[self logData: data];
|
||||
}
|
||||
|
||||
if (task)
|
||||
{
|
||||
[handle waitForDataInBackgroundAndNotify];
|
||||
}
|
||||
else
|
||||
{
|
||||
[NOTIFICATION_CENTER removeObserver: self
|
||||
name: NSFileHandleDataAvailableNotification
|
||||
object: handle];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Log error out.
|
||||
*/
|
||||
- (void) logErrOut:(NSNotification *)aNotif
|
||||
{
|
||||
NSData *data;
|
||||
NSFileHandle *handle = error_handle;
|
||||
|
||||
if ((data = [handle availableData]) && [data length] > 0)
|
||||
{
|
||||
// [self logString: @"\n" newLine: NO];
|
||||
[self logData: data];
|
||||
}
|
||||
|
||||
if (task)
|
||||
{
|
||||
[handle waitForDataInBackgroundAndNotify];
|
||||
}
|
||||
else
|
||||
{
|
||||
[NOTIFICATION_CENTER removeObserver:self
|
||||
name: NSFileHandleDataAvailableNotification
|
||||
object: handle];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notified when the task is completed.
|
||||
*/
|
||||
- (void) taskDidTerminate: (NSNotification *)notif
|
||||
{
|
||||
NSLog(@"Task Terminated...");
|
||||
[self logString: [self stopMessage]
|
||||
newLine:YES];
|
||||
}
|
||||
|
||||
/**
|
||||
* Message to print when the task starts
|
||||
*/
|
||||
- (NSString *) startMessage
|
||||
{
|
||||
return @"=== Task Started ===";
|
||||
}
|
||||
|
||||
/**
|
||||
* Message to print when the task stops
|
||||
*/
|
||||
- (NSString *) stopMessage
|
||||
{
|
||||
return @"\n=== Task Stopped ===";
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the program.
|
||||
*/
|
||||
- (void) runProgram: (NSString *)path
|
||||
inCurrentDirectory: (NSString *)directory
|
||||
withArguments: (NSArray *)array
|
||||
logStandardError: (BOOL)logError
|
||||
{
|
||||
task = [[NSTask alloc] init];
|
||||
[task setArguments: array];
|
||||
[task setCurrentDirectoryPath: directory];
|
||||
[task setLaunchPath: path];
|
||||
|
||||
master_fd = [self openpty];
|
||||
if(master_fd > 0)
|
||||
{
|
||||
if(slave_fd > 0)
|
||||
{
|
||||
slave_handle = [[NSFileHandle alloc] initWithFileDescriptor: slave_fd];
|
||||
master_handle = [[NSFileHandle alloc] initWithFileDescriptor: master_fd];
|
||||
[task setStandardOutput: slave_handle];
|
||||
[task setStandardInput: slave_handle];
|
||||
|
||||
[master_handle waitForDataInBackgroundAndNotify];
|
||||
|
||||
// Log standard error, if requested.
|
||||
if(logError)
|
||||
{
|
||||
[task setStandardError: [NSPipe pipe]];
|
||||
error_handle = [[task standardError] fileHandleForReading];
|
||||
[error_handle waitForDataInBackgroundAndNotify];
|
||||
|
||||
[NOTIFICATION_CENTER addObserver:self
|
||||
selector:@selector(logErrOut:)
|
||||
name:NSFileHandleDataAvailableNotification
|
||||
object:error_handle];
|
||||
}
|
||||
|
||||
// set up notifications to get data.
|
||||
[NOTIFICATION_CENTER addObserver:self
|
||||
selector:@selector(logStdOut:)
|
||||
name:NSFileHandleDataAvailableNotification
|
||||
object:master_handle];
|
||||
|
||||
|
||||
[NOTIFICATION_CENTER addObserver:self
|
||||
selector:@selector(taskDidTerminate:)
|
||||
name:NSTaskDidTerminateNotification
|
||||
object:task];
|
||||
|
||||
// run the task...
|
||||
NS_DURING
|
||||
{
|
||||
[self logString: [self startMessage]
|
||||
newLine:YES];
|
||||
[task launch];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSRunAlertPanel(@"Problem Launching Debugger",
|
||||
[localException reason],
|
||||
@"OK", nil, nil, nil);
|
||||
|
||||
|
||||
NSLog(@"Task Terminated Unexpectedly...");
|
||||
[self logString: @"\n=== Task Terminated Unexpectedly ===\n"
|
||||
newLine:YES];
|
||||
|
||||
//Clean up after task is terminated
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: NSTaskDidTerminateNotification
|
||||
object: task];
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void) terminate
|
||||
{
|
||||
if(task)
|
||||
{
|
||||
[task terminate];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[NOTIFICATION_CENTER removeObserver: self];
|
||||
[self terminate];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) putString: (NSString *)string;
|
||||
{
|
||||
unichar *str = (unichar *)[string cStringUsingEncoding: [NSString defaultCStringEncoding]];
|
||||
int len = strlen((char *)str);
|
||||
NSData *data = [NSData dataWithBytes: str length: len];
|
||||
[master_handle writeData: data];
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a single character into the stream.
|
||||
*/
|
||||
- (void) putChar:(unichar)ch
|
||||
{
|
||||
NSData *data = [NSData dataWithBytes: &ch length: 1];
|
||||
[master_handle writeData: data];
|
||||
}
|
||||
|
||||
- (void) interrupt
|
||||
{
|
||||
[task interrupt];
|
||||
}
|
||||
|
||||
/**
|
||||
* Respond to key events and pipe them down to the debugger
|
||||
*/
|
||||
- (void) keyDown: (NSEvent*)theEvent
|
||||
{
|
||||
NSString *chars;
|
||||
|
||||
chars = [theEvent characters];
|
||||
if ([chars length] == 1)
|
||||
{
|
||||
unichar c;
|
||||
c = [chars characterAtIndex: 0];
|
||||
|
||||
if (c == 3) // ETX, Control-C
|
||||
{
|
||||
[self interrupt]; // send the interrupt signal to the subtask
|
||||
}
|
||||
else
|
||||
{
|
||||
[self putChar: c];
|
||||
}
|
||||
}
|
||||
}
|
||||
@end
|
Binary file not shown.
Binary file not shown.
|
@ -30,6 +30,7 @@ ProjectCenter_RESOURCE_FILES= \
|
|||
Resources/FileHH.tiff \
|
||||
Resources/FileM.tiff \
|
||||
Resources/FileMH.tiff \
|
||||
Resources/FileMM.tiff \
|
||||
Resources/LineJumper.gorm
|
||||
|
||||
#
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue