Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundles/org.eclipse.swt.tools/gtk/rebuild_swt_natives.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ temp_log_file="$(mktemp)" # Keep log so we can count warnings after.
# 'script' command logs commands and their output.
# This is used instead of output redirection to preserve make colouring output,
# while at the same time capture log for parsing.
# (Dev note: old 'build.sh' did not have '-gtk-all' paramater and 'install' was broken.
# (Dev note: old 'build.sh' did not have '-gtk-all' parameter and 'install' was broken.
# For really old SWT builds, may need to manually copy '.so' files and manually specify GTK3)
script --quiet --return --command " ./build.sh -gtk-all install" $temp_log_file #"script" cmd preserves color coding during logging.
if [ "$?" -ne 0 ]; then # Failed
Expand Down
14 changes: 7 additions & 7 deletions bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

HELP="
Build GTK4 or GTK3 bindings and (optionally) copy them to binary repository.
Paramaters (specified in this order):
clean - delete *.o and *.so files from current folder. If this is the only paramater, do nothing else.
But if other paramaters are given and this is the first one, then continue with other actions.
Parameters (specified in this order):
clean - delete *.o and *.so files from current folder. If this is the only parameter, do nothing else.
But if other parameters are given and this is the first one, then continue with other actions.

One of the following 3:
-gtk3 : Build bindings with GTK3.
Expand Down Expand Up @@ -213,10 +213,10 @@ fi

# Safety check:
# If "install" was given as target, check that OUTPUT_DIR is a valid directory.
for i in "$@"; do # loop over all input paramaters
for i in "$@"; do # loop over all input parameters
if [ "$i" = "install" ]; then
if [ ! -d "${OUTPUT_DIR}" ]; then # if directory not valid.
func_echo_error "ERROR: 'install' was passed in as paramater, but OUTPUT_DIR :"
func_echo_error "ERROR: 'install' was passed in as parameter, but OUTPUT_DIR :"
func_echo_error "(${OUTPUT_DIR}) "
func_echo_error "is not a valid directory."
func_echo_error "Exit with failure"
Expand All @@ -225,7 +225,7 @@ for i in "$@"; do # loop over all input paramaters
fi
done

for i in "$@"; do # loop over all input paramaters
for i in "$@"; do # loop over all input parameters
if [ "$i" = "--print-outputdir-and-exit" ]; then
# used by external scripts to find binary folder
echo "OUTPUT_DIR=${OUTPUT_DIR}"
Expand All @@ -243,7 +243,7 @@ if [ "x${1}" = "xclean" ]; then
shift

# if there are no more other parameters, exit.
# don't exit if there are more paramaters. Useful for one-liners like: ./build.sh clean -gtk-all install
# don't exit if there are more parameters. Useful for one-liners like: ./build.sh clean -gtk-all install
if [ "$1" = "" ]; then
exit $?
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2082,8 +2082,8 @@ public boolean setUrl (String url, String postData, String[] headers) {
{ // Extract result meta data
// Get Media Type from Content-Type
String content_type = conn.getContentType();
int paramaterSeparatorIndex = content_type.indexOf(';');
mime_type = paramaterSeparatorIndex > 0 ? content_type.substring(0, paramaterSeparatorIndex) : content_type;
int parameterSeparatorIndex = content_type.indexOf(';');
mime_type = parameterSeparatorIndex > 0 ? content_type.substring(0, parameterSeparatorIndex) : content_type;

// Get Encoding if defined
if (content_type.indexOf(';') > 0) {
Expand Down
6 changes: 3 additions & 3 deletions docs/gtk-dev-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,12 @@ C enums don't map onto Java's enums. Instead, to add an enum like GtkAlign to OS
public static final int GTK_ALIGN_CENTER = 3;
public static final int GTK_ALIGN_BASELINE = 4;

And when you declare a function, delcare the java-doc paramater cast like this:
And when you declare a function, delcare the java-doc parameter cast like this:

@param gtkalign cast=(GtkAlign) // note (GtkAlign) with no pointer, not (GtkAlign *)


This will allow the native call to understand that the paramater is an enum.
This will allow the native call to understand that the parameter is an enum.

**Appendix: Special custom bindings**

Expand All @@ -460,7 +460,7 @@ Suppose you have:
_g_object_set(long /*int*/ object, byte[] first_property_name, GdkRGBA data, long /*int*/ terminator); ### GdkRGBA is specific to GTK3.


Add the method signature to OS.java. Clean the project and attempt a build. You will get a build error about GdkRGBA paramater in g_object_set(). This is because GdkRGBA only exists in GTK3.4+.
Add the method signature to OS.java. Clean the project and attempt a build. You will get a build error about GdkRGBA parameter in g_object_set(). This is because GdkRGBA only exists in GTK3.4+.

Now search os.c for "NO__ …. g object set ", you will find something like:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static void main(String[] args) {

final Text jsConsole = new Text(shell, SWT.BORDER);
// jsConsole.setText("document.body.innerHTML = theJavaFunction(123, 'hello', null, true)");
jsConsole.setText("document.body.innerHTML = theJavaFunction()"); // Case where there are no paramaters.
jsConsole.setText("document.body.innerHTML = theJavaFunction()"); // Case where there are no parameters.
jsConsole.setSelection(jsConsole.getText().length());
GridData data = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
jsConsole.setLayoutData(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private static Browser makeBrowserWithConsole(Composite leftBrowser, String func
leftBrowser.setLayout(gridLayout);

final Text jsConsole = new Text(leftBrowser, SWT.BORDER);
jsConsole.setText("document.body.innerHTML = " + funcName + "(123)"); // Case where there are no paramaters.
jsConsole.setText("document.body.innerHTML = " + funcName + "(123)"); // Case where there are no parameters.
jsConsole.setSelection(jsConsole.getText().length());
GridData data = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
jsConsole.setLayoutData(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private static Browser makeBrowserWithConsole(Composite leftBrowser, String func
leftBrowser.setLayout(gridLayout);

final Text jsConsole = new Text(leftBrowser, SWT.BORDER);
jsConsole.setText("document.body.innerHTML = " + funcName + "(123)"); // Case where there are no paramaters.
jsConsole.setText("document.body.innerHTML = " + funcName + "(123)"); // Case where there are no parameters.
jsConsole.setSelection(jsConsole.getText().length());
GridData data = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
jsConsole.setLayoutData(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void main(String[] args) {

final Text jsConsole = new Text(shell, SWT.BORDER);
// jsConsole.setText("document.body.innerHTML = theJavaFunction(123, 'hello', null, true)");
jsConsole.setText("document.body.innerHTML = theJavaFunction()"); // Case where there are no paramaters.
jsConsole.setText("document.body.innerHTML = theJavaFunction()"); // Case where there are no parameters.
jsConsole.setSelection(jsConsole.getText().length());
GridData data = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
jsConsole.setLayoutData(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ public void column_header_icons_Snippet297() {
}

/**
* Based on Snippet 106 with some modificaitons.
* Based on Snippet 106 with some modifications.
*/
@Test
public void column_dynamically_added_after_shellOpened_Snippet106() {
Expand Down Expand Up @@ -1032,7 +1032,7 @@ public void color_differentCells_Snippet129 () {
}

@Test
public void programaticScrolling_Snippet52() {
public void programmaticScrolling_Snippet52() {
Shell shell = mkShell("Table should be scrolled down to 100th item");
Table table = new Table (shell, SWT.BORDER | SWT.MULTI);
Rectangle clientArea = shell.getClientArea ();
Expand Down
Loading