diff --git a/src/dorkbox/jna/rendering/DefaultProvider.java b/src/dorkbox/jna/rendering/DefaultProvider.java deleted file mode 100644 index a676fa6..0000000 --- a/src/dorkbox/jna/rendering/DefaultProvider.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2021 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dorkbox.jna.rendering; - -class DefaultProvider implements Renderer { - @Override - public - boolean isSupported() { - return true; - } - - @Override - public - ProviderType getType() { - return ProviderType.NONE; - } - - @Override - public - boolean alreadyRunning() { - return false; - } - - @Override - public - boolean isEventThread() { - return false; - } - - @Override - public - int getGtkVersion() { - return 0; - } - - @Override - public - boolean dispatch(final Runnable runnable) { - return false; - } -} diff --git a/src/dorkbox/jna/rendering/ProviderType.java b/src/dorkbox/jna/rendering/ProviderType.java deleted file mode 100644 index 43177d7..0000000 --- a/src/dorkbox/jna/rendering/ProviderType.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2021 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dorkbox.jna.rendering; - -public -enum ProviderType { - SWT, JAVAFX, NONE -} diff --git a/src/dorkbox/jna/rendering/RenderProvider.java b/src/dorkbox/jna/rendering/RenderProvider.java deleted file mode 100644 index a460987..0000000 --- a/src/dorkbox/jna/rendering/RenderProvider.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright 2021 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dorkbox.jna.rendering; - -/** - * A "RenderProvider", is either None (internal implementation), JavaFX (either from Oracle, or the OpenJavaFX), or SWT (from Eclipse). - */ -public -class RenderProvider { - private static Renderer provider = new DefaultProvider(); - - /** - * Assigns the specified provider. This is primarily used by the SystemTray and GTK applications. - * - * @param provider which provider is used. This will change from the default provider to SWT or JAVAFX - */ - public static void set(Renderer provider) { - RenderProvider.provider = provider; - } - - /** - * @return true if the render provider is supported (correct library versions, etc) - */ - public static - boolean isSupported() { - return provider.isSupported(); - } - - /** - * @return true if the GTK provider type is the default provider. - */ - public static - boolean isDefault() { - return provider.getType() == ProviderType.NONE; - } - - /** - * @return true if the GTK provider type is JavaFX. - */ - public static - boolean isJavaFX() { - return provider.getType() == ProviderType.JAVAFX; - } - - /** - * @return true if the GTK provider type is SWT - */ - public static - boolean isSwt() { - return provider.getType() == ProviderType.SWT; - } - - /** - * @return the GTK provider type. SWT or JAVAFX (or none, if it's the null provider) - */ - public static - ProviderType getType() { - return provider.getType(); - } - - /** - * Necessary to determine if the current execution thread is the event dispatch thread, or a different thread - * - * @return true if the current thread is the dispatch/event thread - */ - public static - boolean isEventThread() { - return provider.isEventThread(); - } - - /** - * Used to discover the in-use version of GTK by the system (where appropriate) during startup. - * - * If this provider is not 'loaded', then this method will not be called. - * - * @return the GTK version in use by the provider. A return 0 will skip this provider's GTK version info - */ - public static - int getGtkVersion() { - return provider.getGtkVersion(); - } - - /** - * If we are currently on the dispatch thread, then we want to execute this task immediately. Otherwise, this task should be executed - * on the dispatch thread - * - * @return true if this task was dispatched by this provider, false if the default provider should handle it - */ - public static - boolean dispatch(final Runnable runnable) { - return provider.dispatch(runnable); - } - - /** - * depending on how the system is initialized, SWT may, or may not, have the gtk_main loop running. It will EVENTUALLY run, so we - * do not want to run our own GTK event loop. - * - * JavaFX is not so strange in how GTK starts, so (at least for now), we only care about SWT being loaded - * - * @return if we are SWT, then we are considered "already running". JavaFx provides a method to detected if it's running at startup - */ - public static - boolean alreadyRunning() { - return provider.alreadyRunning(); - } -} diff --git a/src/dorkbox/jna/rendering/Renderer.java b/src/dorkbox/jna/rendering/Renderer.java deleted file mode 100644 index 2425c49..0000000 --- a/src/dorkbox/jna/rendering/Renderer.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2021 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dorkbox.jna.rendering; - -public -interface Renderer { - boolean isSupported(); - - /** - * @return the GTK provider type. SWT or JAVAFX - */ - ProviderType getType(); - - /** - * depending on how the system is initialized, SWT may, or may not, have the gtk_main loop running. It will EVENTUALLY run, so we - * do not want to run our own GTK event loop. - *

- * JavaFX is not so strange in how GTK starts, so (at least for now), we only care about SWT being loaded - * - * @return if we are SWT, then we are considered "already running" - */ - boolean alreadyRunning(); - - /** - * Necessary to determine if the current execution thread is the event dispatch thread, or a different thread - * - * @return true if the current thread is the dispatch/event thread - */ - boolean isEventThread(); - - /** - * Used to discover the in-use version of GTK by the system (where appropriate) during startup. - *

- * If this provider is not 'loaded', then this method will not be called. - * - * @return the GTK version in use by the provider. A value of 0 means "ignore this" - */ - int getGtkVersion(); - - boolean dispatch(final Runnable runnable); -} diff --git a/src9/dorkbox/jna/EmptyClass.java b/src9/dorkbox/jna/EmptyClass.java deleted file mode 100644 index bcdac6e..0000000 --- a/src9/dorkbox/jna/EmptyClass.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2021 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dorkbox.jna; - -/** - * Required for intellij to not complain regarding `module-info` for a multi-release jar. - * This file is completely ignored by the gradle build process - */ -public -class EmptyClass {} diff --git a/src9/dorkbox/jna/linux/EmptyClass.java b/src9/dorkbox/jna/linux/EmptyClass.java deleted file mode 100644 index b4419be..0000000 --- a/src9/dorkbox/jna/linux/EmptyClass.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2021 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dorkbox.jna.linux; - -/** - * Required for intellij to not complain regarding `module-info` for a multi-release jar. - * This file is completely ignored by the gradle build process - */ -public -class EmptyClass {} diff --git a/src9/dorkbox/jna/linux/structs/EmptyClass.java b/src9/dorkbox/jna/linux/structs/EmptyClass.java deleted file mode 100644 index da83465..0000000 --- a/src9/dorkbox/jna/linux/structs/EmptyClass.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2021 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dorkbox.jna.linux.structs; - -/** - * Required for intellij to not complain regarding `module-info` for a multi-release jar. - * This file is completely ignored by the gradle build process - */ -public -class EmptyClass {} diff --git a/src9/dorkbox/jna/macos/EmptyClass.java b/src9/dorkbox/jna/macos/EmptyClass.java deleted file mode 100644 index c2778d2..0000000 --- a/src9/dorkbox/jna/macos/EmptyClass.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2021 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dorkbox.jna.macos; - -/** - * Required for intellij to not complain regarding `module-info` for a multi-release jar. - * This file is completely ignored by the gradle build process - */ -public -class EmptyClass {} diff --git a/src9/dorkbox/jna/macos/cocoa/EmptyClass.java b/src9/dorkbox/jna/macos/cocoa/EmptyClass.java deleted file mode 100644 index cc18344..0000000 --- a/src9/dorkbox/jna/macos/cocoa/EmptyClass.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2021 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dorkbox.jna.macos.cocoa; - -/** - * Required for intellij to not complain regarding `module-info` for a multi-release jar. - * This file is completely ignored by the gradle build process - */ -public -class EmptyClass {} diff --git a/src9/dorkbox/jna/macos/foundation/EmptyClass.java b/src9/dorkbox/jna/macos/foundation/EmptyClass.java deleted file mode 100644 index ecc43ba..0000000 --- a/src9/dorkbox/jna/macos/foundation/EmptyClass.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2021 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dorkbox.jna.macos.foundation; - -/** - * Required for intellij to not complain regarding `module-info` for a multi-release jar. - * This file is completely ignored by the gradle build process - */ -public -class EmptyClass {} diff --git a/src9/dorkbox/jna/rendering/EmptyClass.java b/src9/dorkbox/jna/rendering/EmptyClass.java deleted file mode 100644 index 587d037..0000000 --- a/src9/dorkbox/jna/rendering/EmptyClass.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2021 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dorkbox.jna.rendering; - -/** - * Required for intellij to not complain regarding `module-info` for a multi-release jar. - * This file is completely ignored by the gradle build process - */ -public -class EmptyClass {} diff --git a/src9/dorkbox/jna/windows/EmptyClass.java b/src9/dorkbox/jna/windows/EmptyClass.java deleted file mode 100644 index fd49692..0000000 --- a/src9/dorkbox/jna/windows/EmptyClass.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2021 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dorkbox.jna.windows; - -/** - * Required for intellij to not complain regarding `module-info` for a multi-release jar. - * This file is completely ignored by the gradle build process - */ -public -class EmptyClass {} diff --git a/src9/dorkbox/jna/windows/structs/EmptyClass.java b/src9/dorkbox/jna/windows/structs/EmptyClass.java deleted file mode 100644 index 0220383..0000000 --- a/src9/dorkbox/jna/windows/structs/EmptyClass.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2021 dorkbox, llc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dorkbox.jna.windows.structs; - -/** - * Required for intellij to not complain regarding `module-info` for a multi-release jar. - * This file is completely ignored by the gradle build process - */ -public -class EmptyClass {}