• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..04-Jun-2020-

.externalToolBuilders/H04-Jun-2020-1514

.settings/H04-Jun-2020-770766

Eclipse SWT/H04-Jun-2020-288,464161,595

Eclipse SWT AWT/H04-Jun-2020-1,218771

Eclipse SWT Accessibility/H04-Jun-2020-21,65312,102

Eclipse SWT Browser/H04-Jun-2020-6,6373,649

Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/H04-Jun-2020-33,06220,022

Eclipse SWT Drag and Drop/H04-Jun-2020-15,3047,305

Eclipse SWT OLE Win32/win32/org/eclipse/swt/H04-Jun-2020-7,2464,843

Eclipse SWT OpenGL/H04-Jun-2020-2,5651,604

Eclipse SWT PI/H04-Jun-2020-200,537173,386

Eclipse SWT Printing/H04-Jun-2020-3,8751,879

Eclipse SWT Program/H04-Jun-2020-1,461904

Eclipse SWT WebKit/H04-Jun-2020-15,67511,350

META-INF/H03-May-2022-6053

about_files/H04-Jun-2020-386314

build/H04-Jun-2020-3029

tasks/H04-Jun-2020-2624

.classpath_cocoaH A D04-Jun-20202.1 KiB3534

.classpath_gtkH A D03-May-20222.1 KiB3736

.classpath_gtk_win32H A D04-Jun-20202.3 KiB3836

.classpath_win32H A D04-Jun-20201.8 KiB3231

.gitignoreH A D04-Jun-202035 54

.projectH A D04-Jun-2020953 4039

Readme.Linux.mdH A D04-Jun-20201.4 KiB4530

Readme.Win32.mdH A D04-Jun-20206.2 KiB12791

Readme.macOS.mdH A D04-Jun-20205.4 KiB9468

Readme.mdH A D04-Jun-20201.7 KiB5235

build.propertiesH A D04-Jun-2020777 2018

build.xmlH A D04-Jun-20202.8 KiB7451

buildFragment.xmlH A D04-Jun-202016.4 KiB356318

buildInternal.xmlH A D04-Jun-20202.1 KiB5124

buildSWT.xmlH A D03-May-202240.9 KiB1,072914

plugin.propertiesH A D04-Jun-2020607 1515

pom.xmlH A D04-Jun-20205.2 KiB9783

Readme.Linux.md

1# About
2
3The SWT Linux port is based on the GTK.
4
5The natives are build using make and (by default) gcc.
6
7# Development overview
8SWT is made up of 2 parts, Java and the natives (written in C).
9
10* **Java Part**
11If you only make changes in the Java part or need to configure SWT for running
12snippets, then you don't need to recompile the natives, instead, you can just
13use the pre-compiled libraries in the binary repository.
14
15* **Natives Part**
16Make sure the binary project for your platform is imported and open in your
17workspace.
18
19## Building Natives
20
21### Building 64bit natives for GTK3
22
23You need to install the following on your system:
24
25* make
26* gcc
27* GTK+ development files (gtk3-devel)
28* Java 8 or 11 JDK
29* (optional) Webkit for GTK development files (webkit2gtk3-devel)
30
31### Building and Testing locally
32
33Import and build the SWT project `bundles/org.eclipse.swt` in Eclipse. See the
34platform independent Readme for how to set the .classpath. This will populate
35the `bundles/org.eclipse.swt/bin/library` with the native code and build files.
36
37To build SWT natives run the `build.sh` script in `./bin/library` directory. To
38use the locally build natives run the build script with the 'install' argument
39(`./build.sh install`) or --help to see more options.
40
41You can find additional information on GTK SWT development can be found in
42Eclipse Wiki.
43
44https://wiki.eclipse.org/SWT/Devel/Gtk/Dev_guide
45

Readme.Win32.md

1# About
2
3The document is structured so that you only need to read up to the point that you require, with advanced topics at the bottom.
4
5The SWT windows port is based on the Win32 api.
6
7The natives are compiled via an ant build.xml script with the Microsoft Visual Studio (2017) C++ compiler.
8
9# Development overview
10SWT is made up of 2 parts, Java and the natives (written in C).
11
12* **Java Part**
13If you only make changes in the Java part or need to configure SWT for running snippets,
14then you don't need to recompile the natives, instead, you can just use the pre-compiled
15libraries in the binary repository.
16
17* **Natives Part**
18(Make sure the binary project for your platform is imported and open in your workspace).
19
20## Configure workspace to run snippets.
21
22* Download & install Java *JDK* (Last tested on JDK9) http://www.oracle.com/technetwork/java/javase/downloads/index.html
23* Download and install Eclipse. Either the "Eclipse IDE for Eclipse Committers" or a recent integration build:
24  http://download.eclipse.org/eclipse/downloads/
25* (Optionally) install CDT from marketplace if you want to work on C/Native parts of SWT.
26* (if not already installed) installed EGit integration.
27* Open the git perspective. Add the following two repositories, which can be found on: (use git protocol)
28	- http://git.eclipse.org/c/platform/eclipse.platform.swt.git/
29	- http://git.eclipse.org/c/platform/eclipse.platform.swt.binaries.git/
30* From swt repo, import most projects (except Cocoa/Gtk, root 'swt' project, once)
31* In org.eclipse.swt project, you need to copy .classpath_win32 to .classpath  & refresh/rebuild workspace.
32  (This can be done via command line or by not-filtering *.resources in package view).
33* From swt.binary repo, import the project that reflects your platform.
34* In the snippet project, add the swt project as dependency to launch snippets.
35* You should be able to run snippets now. (e.g Snippet1).
36
37## (Advanced) Building Natives.
38
39### Building just 64bit natives with no Webkit
40(Last tested on Win10 64 bit & Java 11. May 2019):
41
42You need to install the following on your system:
43
44* Microsoft Visual Studio - Community and Windows 10 SDK:  (1*)
45  https://visualstudio.microsoft.com/vs/community/
46  Either select the components "MSVC C++-x64/x86-Buildtools" and "Windows 10 SDK"
47  or the workload "Desktop development with C++" which includes the required components and some more.
48* (Optional) Install Cygwin
49* Install Java 8 or 11. Oracle JDK or IBM JDK:
50  http://www.oracle.com/technetwork/java/javase/overview/java8-2100321.html
51  https://developer.ibm.com/javasdk/downloads/
52
53### Building and Testing locally
54
55In the binary git repo, in the windows project, you can build the natives via the build.xml. To do so:
56
57* In Eclipse, in the binary project org.eclipse.swt.win32.win32.x86_64, right click on build.xml:
58* Run As -> Ant Build ...
59* On the Targets tab check the build_libraries target  (it should be the only one check for just the natives).
60* On the JRE tab select "Run in the same JRE as the workspace"
61* On the Refresh tab check "Refresh resources upon completion" to refresh your workspace after running the build; this ensures that Eclipse will pick up the fresh binaries
62* Press the "Run" button to begin.
63* If compile fails, inspect build log for warnings, they can point out issues in your configuration.
64
65To test if you binaries actually get used, you could try to checkout an older binary repo commit with old
66bindings. Then try to run a snippet and get the 'missing natives' error. Then if you build the natives
67and the snippet(s) work, it shows that you've build them successfully.
68
69### Optional additional configuration
70* Install and configure Cygwin SSH Server on Windows. (Make sure 'openssh' package is installed).
71  See: https://docs.oracle.com/cd/E24628_01/install.121/e22624/preinstall_req_cygwin_ssh.htm#EMBSC281
72* Configure the machine for password-less SSH authentication with the Hudson machine.
73  For more details you can refer: http://users.cecs.anu.edu.au/~xzhang/pubDoc/IT/SSH%20without%20password%20from%20Windows.htm
74  Sharing some key steps below(which I recall):
75  - Generate the 'dsa' public/private key from your "swtbuild" account from windows machine.
76  - Now login to the Hudson machine with "swtbuild" account.
77  - Copy the public keys and register then on the Hudson machine.. this should enable password-less authentication.
78
79## (More advanced) (Optional) Building Webkit
80Note, I.E is the default backend. But Webkit is also a possible alternative Browser backend.
81
82Disclaimer:
83
84Note Webkit SDKs are an older version being consumed by SWT native build process and Webkit build binaries are no more available for download in public Webkit download page (https://webkit.org/downloads/)
85
86But WebKit-r72896 sources are still avilable for download via either of:
87https://builds-nightly.webkit.org/files/trunk/src/WebKit-r72896.tar.bz2
88http://build.eclipse.org/eclipse/swt/WebKit-r72896.tar.bz2
89
90Webkit SDKs:
91
92* WebKit-r72896 http://build.eclipse.org/eclipse/swt/WebKit-r72896.zip
93* WebKitSupportLibrary http://build.eclipse.org/eclipse/swt/WebKitSupportLibrary.zip
94
95
96Steps:
97
98* Create an SWT Build dir such as `C:\SWT_BUILD_DIR`
99* In your enviornment:
100    `set SWT_BUILD_DIR=YOUR.DIR`
101* Unzip two Webkit SDks into:
102  - `SWT_BUILD_DIR\Webkit\r72896`
103  - `SWT_BLUID_DIR\Webkit\SupportLibrary`
104  - (Note: SWT's Webkit support exists for SWT 32bit on Windows, so Webkit SDKs are consumed only by the SWT 32bit build process)
105
106## Custom Java paths and 32 bit builds
107
108You can specify a specific java sdk via:
109  `set SWT_JAVA_HOME=<YOUR_PATH>`
110
111To do a 32 bit build, install a 32bit java & specify it's path or put it into:
112`SWT_BUILD_DIR\Java\Oracle\jdk1.8.0-latest\x86`
113
114For building windows native build for 32bit, you need to convert the source to 32bit first, by running 'replace.64.to.32' target.
115Once sources are converted to 32bit you can run the 'build_libraries' target for ${workspace_loc:/org.eclipse.swt.win32.win32.x86/build.xml}
116
117## Hudson
118(Optional for local setup)
119Now you can point the Windows hudson job to this machine and trigger a native build.
120Note: For testing purpose from hudson, temporarily turn the nativeChanges flag to 'true' to force a native build compilation.
121
122# Footnotes
123[1]  https://bugs.eclipse.org/bugs/show_bug.cgi?id=526802
124
125
126
127

Readme.macOS.md

1macOS Development for org.eclipse.swt
2=====================================
3
4Please follow the following pattern for macOS development:
5
6* Copy `.classpath_cocoa` to `.classpath`
7* Update `.bridgesupport` files when necessary, i.e. consuming new api in newer macOS versions
8* Generate native and Java code using `MacGenerator`
9
10
11
12Updating .bridgesupport files
13-----------------------------
14
15The `.bridgesupport` files are located in `Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa`. They are
16generated using the tool `gen_bridge_metadata` which is included with macOS (Xcode).
17
18Please note that we use an undocumented option with the `gen_bridge_metadata` to generate a complete XML including the `declared_type`.
19It's not clear why that option is undocumented.
20
21FWIW, there seems to be an issue with the tool that is included in macOS. After lots of reading and asking questions, it seems that
22the best approach is to build a current version yourself and launch it from there
23(see tip [here](https://twitter.com/watson1978/status/786929396711948288)).
24
25    git clone https://github.com/HipByte/BridgeSupport.git
26    cd BridgeSupport
27    make
28
29    # once done let's define a function to make generation more convenient
30    #
31    # gen_bridge_metadata_complete() {
32    #    RUBYLIB=./DSTROOT/System/Library/BridgeSupport/ruby-2.0                 \
33    #    ./gen_bridge_metadata.rb                                                \
34    #        --format complete                                                   \
35    #        --cflags "-I.                                                       \
36    #                  -isysroot /                                               \
37    #                  -mmacosx-version-min=10.12                                \
38    #                  -DTARGET_OS_MAC=1                                         \
39    #                  -D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=101200    \
40    #                  -F/System/Library/Frameworks                              \
41    #                  -framework $1 "                                           \
42    #        --framework /System/Library/Frameworks/$1.framework
43    #  }
44    #
45    # (now all in one line)
46    gen_bridge_metadata_complete() { RUBYLIB=$(pwd)/DSTROOT/System/Library/BridgeSupport/ruby-2.0 $(pwd)/gen_bridge_metadata.rb --format complete --cflags "-I. -isysroot / -mmacosx-version-min=10.12 -DTARGET_OS_MAC=1 -D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=101200 -F/System/Library/Frameworks -framework $1" --framework /System/Library/Frameworks/$1.framework; }
47
48Once done with that, go back into the `org.eclipse.swt` bundle directory and execute the following commands to generate all the `.bridgesupport` files.
49
50     # should be executed from the BridgeSupport directory
51     # (where the gen_bridge_metadata is located)
52     #
53     gen_bridge_metadata_complete AppKit            > '<org.eclipse.swt>/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport'
54     gen_bridge_metadata_complete CoreFoundation    > '<org.eclipse.swt>/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreFoundationFull.bridgesupport'
55     gen_bridge_metadata_complete CoreText          > '<org.eclipse.swt>/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CoreTextFull.bridgesupport'
56     gen_bridge_metadata_complete Foundation        > '<org.eclipse.swt>/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/FoundationFull.bridgesupport'
57     gen_bridge_metadata_complete SecurityInterface > '<org.eclipse.swt>/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SecurityInterfaceFull.bridgesupport'
58     gen_bridge_metadata_complete WebKit.framework  > '<org.eclipse.swt>/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/WebKitFull.bridgesupport'
59
60The `.extras` files are created by the `MacGenerator` later. They store additional information (eg., how types are mapped to SWT).
61We don't need to worry about them now.
62
63
64Generate code using MacGenerator
65--------------------------------
66
67There are two possible option:
68
69* Install the `org.eclipse.swt.tools` plug-in into Eclipse and use the view.
70* Import the `org.eclipse.swt.tools` project into a second workspace and run `MacGeneratorUI` as vanilla Java application.
71
72Running `MacGeneratorUI` from within a second workspace has the benefit that you can tweak the `MacGeneratorUI` tool should you run into any issues.
73It should consume `org.eclipse.swt` from a target platform (not in source form). The project `org.eclipse.swt.tools.base` and `org.eclipse.swt.tools.spies`
74should also be in that second workspace.
75
76Please note that `MacGeneratorUI` makes certain assumptions (hard-coded) about the environment and paths. That's usually fine
77because all is within the same Git repository. It should only break when things are restructured without adjusting it. However, that's also
78the reason why you should run it from within a second workspace with SWT consumed from a target platform. It modifies SWT *in* the same
79Git repo. If SWT is also in the same workspace, you will run into issues once some generation breaks SWT.
80
81More information on how to use the generator is available [here](https://www.eclipse.org/swt/macgen.php). Volunteers wanted to convert
82this information into this readme.
83
84
85Compiling native libs
86---------------------
87
88This is done from within the binaries project.
89
90    cd <eclipse.platform.swt.binaries>/bundles/org.eclipse.swt.cocoa.macosx.x86_64
91    mvn clean package -Dnative=cocoa.macosx.x86_64 -Pbuild-individual-bundles
92
93
94Happy development!

Readme.md

1org.eclipse.swt
2===============
3
4Main plug-in for the SWT user interface library.
5
6Setting the classpath:
7----------------------
8
9To compile this project, you need to set the classpath specific for your operating and windowing system.
10For this, rename one of the following files to `.classpath`:
11
12* .classpath_win32 - Windows
13* .classpath_cocoa - Mac OS X
14* .classpath_gtk - Linux and all Unix variants
15
16Similar class paths renaming should be done for ./examples/org.eclipse.swt.snippets/
17
18To see these files, you may have to remove the filter for ".* resources":
19* In the Project Explorer: view menu > Customize View... > Filters
20* In the Package Explorer: view menu > Filters...
21
22
23Dependencies:
24-------------
25
26* **SWT Binaries**
27  You also need to clone the binary Git repository:
28  https://git.eclipse.org/r/#/admin/projects/platform/eclipse.platform.swt.binaries
29  and import the project for your platform into your workspace.
30
31  Ensure that the fragment matching your windowingSystem.operatingSystem.cpuArchitecture
32  (e.g. org.eclipse.swt.gtk.linux.x86_64) is open in your workspace.
33  The fragments provide the platform-specific native libraries.
34
35Using Assertions:
36----------------
37Assertions are added to the code. These don't run in production, but they do when:
38* JUnits are ran, they turn on assertions by default.
39* If you run a java run configuration and add '-ea' to the 'VM Arguments'
40
41Assertions look like:
42
43	assert expression ;
44	assert expression : msg ;
45
46See: https://docs.oracle.com/javase/8/docs/technotes/guides/language/assert.html
47
48More Information:
49-----------------
50
51See the [Readme.md](../../Readme.md) in the main directory of the Git repository for this project to learn more about SWT development.
52