├── .gitignore ├── .gitmodules ├── .travis.yml ├── README.md ├── bootstrap ├── .gitignore ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── trinity │ │ └── bootstrap │ │ └── EntryPoint.java │ └── resources │ └── logback.xml ├── eclipsesettings ├── codestyle-cleanup.xml ├── codestyle-codetemplates.xml └── codestyle-formatting.xml ├── foundation ├── .gitignore ├── api │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── trinity │ │ │ └── foundation │ │ │ └── api │ │ │ ├── display │ │ │ ├── Display.java │ │ │ ├── DisplayArea.java │ │ │ ├── DisplayAreaManipulator.java │ │ │ ├── DisplaySurface.java │ │ │ ├── DisplaySurfaceFactory.java │ │ │ ├── DisplaySurfaceHandle.java │ │ │ ├── Module.java │ │ │ ├── Screen.java │ │ │ ├── bindkey │ │ │ │ └── DisplayExecutor.java │ │ │ ├── event │ │ │ │ ├── CreationNotify.java │ │ │ │ ├── DestroyNotify.java │ │ │ │ ├── DisplayEvent.java │ │ │ │ ├── FocusGainNotify.java │ │ │ │ ├── FocusLostNotify.java │ │ │ │ ├── FocusNotify.java │ │ │ │ ├── GeometryNotify.java │ │ │ │ ├── GeometryRequest.java │ │ │ │ ├── HideNotify.java │ │ │ │ ├── PointerEnterNotify.java │ │ │ │ ├── PointerLeaveNotify.java │ │ │ │ ├── PointerVisitationNotify.java │ │ │ │ ├── ShowNotify.java │ │ │ │ ├── ShowRequest.java │ │ │ │ ├── StackingChangedNotify.java │ │ │ │ └── package-info.java │ │ │ └── package-info.java │ │ │ ├── render │ │ │ ├── Painter.java │ │ │ ├── PainterFactory.java │ │ │ ├── binding │ │ │ │ ├── Binder.java │ │ │ │ ├── model │ │ │ │ │ ├── PropertyChanged.java │ │ │ │ │ └── ViewReference.java │ │ │ │ ├── package-info.java │ │ │ │ └── view │ │ │ │ │ ├── DataContext.java │ │ │ │ │ ├── DefaultPropertyAdapter.java │ │ │ │ │ ├── EventSignal.java │ │ │ │ │ ├── EventSignalFilter.java │ │ │ │ │ ├── EventSignals.java │ │ │ │ │ ├── ObservableCollection.java │ │ │ │ │ ├── PropertyAdapter.java │ │ │ │ │ ├── PropertySlot.java │ │ │ │ │ ├── PropertySlots.java │ │ │ │ │ ├── delegate │ │ │ │ │ ├── ChildViewDelegate.java │ │ │ │ │ ├── PropertySlotInvocatorDelegate.java │ │ │ │ │ ├── Signal.java │ │ │ │ │ └── package-info.java │ │ │ │ │ └── package-info.java │ │ │ ├── bindkey │ │ │ │ └── RenderExecutor.java │ │ │ └── package-info.java │ │ │ └── shared │ │ │ ├── AsyncListenable.java │ │ │ ├── AsyncListenableEventBus.java │ │ │ ├── Coordinate.java │ │ │ ├── ExecutionContext.java │ │ │ ├── ImmutableRectangle.java │ │ │ ├── Margins.java │ │ │ ├── Rectangle.java │ │ │ ├── Size.java │ │ │ └── package-info.java │ │ └── test │ │ └── java │ │ └── org │ │ └── trinity │ │ └── foundation │ │ └── api │ │ └── shared │ │ └── AsyncListenableEventBusTest.java ├── display.x11.api │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── trinity │ │ └── foundation │ │ └── display │ │ └── x11 │ │ └── api │ │ ├── Module.java │ │ ├── XConnection.java │ │ ├── XEventHandler.java │ │ ├── XScreen.java │ │ ├── XWindowCache.java │ │ ├── XcbErrorUtil.java │ │ └── bindkey │ │ └── XEventBus.java ├── display.x11.impl │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── trinity │ │ │ └── foundation │ │ │ └── display │ │ │ └── x11 │ │ │ └── impl │ │ │ ├── Module.java │ │ │ ├── XConnectionImpl.java │ │ │ ├── XDisplayImpl.java │ │ │ ├── XEventHandlers.java │ │ │ ├── XEventPump.java │ │ │ ├── XScreenImpl.java │ │ │ ├── XTime.java │ │ │ ├── XWindow.java │ │ │ ├── XWindowCacheImpl.java │ │ │ ├── XWindowHandle.java │ │ │ └── event │ │ │ ├── CirculateNotifyHandler.java │ │ │ ├── ConfigureNotifyHandler.java │ │ │ ├── ConfigureRequestHandler.java │ │ │ ├── DestroyNotifyHandler.java │ │ │ ├── EnterNotifyHandler.java │ │ │ ├── FocusInHandler.java │ │ │ ├── FocusOutHandler.java │ │ │ ├── GenericErrorHandler.java │ │ │ ├── LeaveNotifyHandler.java │ │ │ ├── MapNotifyHandler.java │ │ │ ├── MapRequestHandler.java │ │ │ └── UnmapNotifyHandler.java │ │ └── test │ │ └── java │ │ └── org │ │ └── trinity │ │ └── foundation │ │ └── display │ │ └── x11 │ │ └── impl │ │ └── XWindowTest.java ├── pom.xml ├── render.binding.impl │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── trinity │ │ │ └── foundation │ │ │ └── api │ │ │ └── render │ │ │ └── binding │ │ │ ├── BinderImpl.java │ │ │ ├── Module.java │ │ │ ├── PropertyChangedSignalDispatcher.java │ │ │ └── SignalImpl.java │ │ └── test │ │ └── java │ │ └── org │ │ └── trinity │ │ └── foundation │ │ └── api │ │ └── render │ │ └── binding │ │ ├── BooleanToStringAdapter.java │ │ ├── CollectionElementView.java │ │ ├── DataContextTest.java │ │ ├── DummyExecutor.java │ │ ├── DummySubModel.java │ │ ├── DummySubSubModel.java │ │ ├── InputSlotBindingTest.java │ │ ├── Model.java │ │ ├── ObservableCollectionBindingTest.java │ │ ├── PropertyBindingTest.java │ │ ├── SubView.java │ │ └── View.java └── render.qt.impl │ ├── .gitignore │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── org │ │ └── trinity │ │ └── foundation │ │ └── render │ │ └── qt │ │ └── impl │ │ ├── RenderApplication.java │ │ ├── RenderDisplaySurfaceHandle.java │ │ ├── RenderEventConversion.java │ │ ├── RenderEventConverter.java │ │ ├── binding │ │ └── view │ │ │ └── delegate │ │ │ ├── ChildViewDelegateImpl.java │ │ │ └── PropertySlotInvocatorDelegateImpl.java │ │ ├── eventconverters │ │ ├── DestroyConversion.java │ │ ├── FocusGainConversion.java │ │ ├── FocusLostConversion.java │ │ ├── MouseEnterConversion.java │ │ └── MouseLeaveConversion.java │ │ └── painter │ │ ├── Module.java │ │ ├── PainterImpl.java │ │ ├── ViewDiscovery.java │ │ ├── ViewEventTracker.java │ │ └── ViewEventTrackerFactory.java │ └── test │ └── java │ └── org │ └── trinity │ ├── foundation │ └── render │ │ └── qt │ │ └── impl │ │ └── painter │ │ └── routine │ │ └── EventInterceptionTest.java │ └── render │ └── qt │ └── impl │ ├── DummyQJRenderEngine.java │ └── DummyView.java ├── pom.xml ├── shell ├── .gitignore ├── api │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── trinity │ │ └── shell │ │ └── api │ │ ├── Module.java │ │ ├── bindingkey │ │ ├── ShellExecutor.java │ │ ├── ShellRootNode.java │ │ ├── ShellScene.java │ │ └── ShellVirtualNode.java │ │ ├── package-info.java │ │ ├── plugin │ │ ├── ShellPlugin.java │ │ ├── ShellPluginsRunner.java │ │ └── package-info.java │ │ ├── scene │ │ ├── AbstractAsyncShellNode.java │ │ ├── AbstractAsyncShellNodeParent.java │ │ ├── AbstractShellNode.java │ │ ├── AbstractShellNodeGeometryDelegate.java │ │ ├── AbstractShellNodeParent.java │ │ ├── ShellNode.java │ │ ├── ShellNodeGeometryDelegate.java │ │ ├── ShellNodeParent.java │ │ ├── ShellNodeTransformation.java │ │ ├── event │ │ │ ├── ShellNodeChildAddedEvent.java │ │ │ ├── ShellNodeChildEvent.java │ │ │ ├── ShellNodeChildLeftEvent.java │ │ │ ├── ShellNodeDestroyedEvent.java │ │ │ ├── ShellNodeEvent.java │ │ │ ├── ShellNodeHiddenEvent.java │ │ │ ├── ShellNodeHideRequestEvent.java │ │ │ ├── ShellNodeLowerRequestEvent.java │ │ │ ├── ShellNodeLoweredEvent.java │ │ │ ├── ShellNodeMoveRequestEvent.java │ │ │ ├── ShellNodeMoveResizeRequestEvent.java │ │ │ ├── ShellNodeMovedEvent.java │ │ │ ├── ShellNodeMovedResizedEvent.java │ │ │ ├── ShellNodeRaiseRequestEvent.java │ │ │ ├── ShellNodeRaisedEvent.java │ │ │ ├── ShellNodeReparentRequestEvent.java │ │ │ ├── ShellNodeReparentedEvent.java │ │ │ ├── ShellNodeResizeRequestEvent.java │ │ │ ├── ShellNodeResizedEvent.java │ │ │ ├── ShellNodeShowRequestEvent.java │ │ │ ├── ShellNodeShowedEvent.java │ │ │ ├── ShellNodeStackingEvent.java │ │ │ ├── ShellNodeStackingRequestEvent.java │ │ │ ├── ShellNodeVisibilityEvent.java │ │ │ ├── ShellNodeVisibilityRequestEvent.java │ │ │ └── package-info.java │ │ ├── manager │ │ │ ├── AbstractShellLayoutManager.java │ │ │ ├── ShellLayoutManager.java │ │ │ ├── ShellLayoutManagerLine.java │ │ │ ├── ShellLayoutProperty.java │ │ │ ├── ShellLayoutPropertyLine.java │ │ │ └── package-info.java │ │ └── package-info.java │ │ ├── surface │ │ ├── AbstractAsyncShellSurface.java │ │ ├── AbstractShellSurface.java │ │ ├── AbstractShellSurfaceGeometryDelegate.java │ │ ├── AbstractShellSurfaceParent.java │ │ ├── ShellSurface.java │ │ ├── ShellSurfaceFactory.java │ │ ├── ShellSurfaceParent.java │ │ └── package-info.java │ │ └── widget │ │ ├── BaseShellWidget.java │ │ ├── BaseShellWidgetGeometryDelegate.java │ │ └── ShellWidget.java ├── plugin.impl │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── trinity │ │ └── shell │ │ └── plugin │ │ └── impl │ │ └── ShellPluginsRunnerImpl.java ├── pom.xml ├── scene.impl │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── trinity │ │ │ └── shell │ │ │ └── scene │ │ │ └── impl │ │ │ ├── ShellVirtualSurface.java │ │ │ ├── ShellVirtualSurfaceExecutor.java │ │ │ └── manager │ │ │ └── ShellLayoutManagerLineImpl.java │ │ └── test │ │ └── java │ │ └── org │ │ └── trinity │ │ └── shell │ │ └── impl │ │ └── node │ │ ├── ShellGeoVNodeTest.java │ │ └── manager │ │ └── ShellLayoutManagerLineTest.java └── surface.impl │ ├── .gitignore │ ├── pom.xml │ └── src │ └── main │ └── java │ └── org │ └── trinity │ └── shell │ └── surface │ └── impl │ ├── ShellClientSurface.java │ ├── ShellSurfaceFactoryImpl.java │ ├── ShellSurfaceGeometryDelegateImpl.java │ └── ShellSurfacePlugin.java ├── shellplugin ├── .gitignore ├── pom.xml ├── widget.view.qt.api │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── trinity │ │ └── shellplugin │ │ └── widget │ │ └── impl │ │ └── view │ │ └── qt │ │ ├── AbstractQWidgetViewProvider.java │ │ ├── LMBSignalFilter.java │ │ └── StyledViewsPlugin.java ├── wm.api │ ├── .gitignore │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── trinity │ │ └── shellplugin │ │ └── wm │ │ └── api │ │ ├── Desktop.java │ │ ├── HasImageDefinition.java │ │ ├── HasText.java │ │ ├── ImageDefinition.java │ │ └── ReceivesPointerInput.java └── wm.x11.impl │ ├── .gitignore │ ├── pom.xml │ └── src │ └── main │ ├── java │ └── org │ │ └── trinity │ │ └── shellplugin │ │ └── wm │ │ └── x11 │ │ └── impl │ │ ├── Module.java │ │ ├── WindowManagerPlugin.java │ │ ├── protocol │ │ ├── XAtomCache.java │ │ ├── XClientMessageHandler.java │ │ ├── XPropertyChangedHandler.java │ │ ├── XWindowProtocol.java │ │ └── icccm │ │ │ ├── AbstractCachedProtocol.java │ │ │ ├── ProtocolListener.java │ │ │ ├── WmHints.java │ │ │ ├── WmName.java │ │ │ ├── WmProtocols.java │ │ │ └── WmState.java │ │ ├── scene │ │ ├── ClientBarElement.java │ │ ├── ClientBarElementFactory.java │ │ ├── Clock.java │ │ ├── SceneManager.java │ │ └── ShellRootWidget.java │ │ └── view │ │ ├── ClientBarElementView.java │ │ ├── Module.java │ │ ├── NotificationsBarElementView.java │ │ ├── RootView.java │ │ └── RootViewProvider.java │ └── resources │ └── views.qss └── site-resources └── HypercubeLogo.png /.gitignore: -------------------------------------------------------------------------------- 1 | *pom.xml.releaseBackup* 2 | *release.properties* 3 | *.settings* 4 | *.project* 5 | *.iml 6 | *.idea 7 | target 8 | trinity.log 9 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "externals/xcb4j"] 2 | path = externals/xcb4j 3 | url = https://github.com/Zubnix/xcb4j.git 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Development on this repository has halted. Instead have a look [here](https://github.com/Zubnix/westmalle)! 2 | 3 | 4 | [![Build Status](https://travis-ci.org/Zubnix/trinityshell.png?branch=0.0.3-SNAPSHOT)](https://travis-ci.org/Zubnix/trinityshell) 5 | 6 | Trinity shell is a Java base desktop shell for Linux. 7 | It is higly modular by design and uses Google Guice to glue different functional modules together. Currently the display module uses XCB through XCB4J to talk to the X display server while the render module uses Qt through QtJambi to do the drawing. Window manager and shell functionality is provided by shell plugins that are loaded by the shell module. 8 | It is still a young project that is usable but not usefull as a lot of very basic window managing controls are still missing. The project's ambition is to become a tool and library for Java developers to build their own fully fledged desktop, including hardware accelerated compositing, tiling window management etc. 9 | 10 | ##Building and Running 11 | 12 | - `git clone git@github.com:Zubnix/trinityshell.git` Clone the project 13 | - `git submodule init` Initialie the submodules 14 | - `git submodule update` Update the submodules 15 | - `cd externals/xcb4j` Go to the xcb4j submodule 16 | - `mvn install` Build the xcb4j sudmoule. In case xcb4j doesn't want to build, have a look at the xcb4j project on github. 17 | - `cd ../..` Go back to the project directory 18 | - `mvn install` Build the project 19 | - `cd bootstrap` Go to the bootstrap directory 20 | - `mvn assembly:assembly` Build a fat jar of the project 21 | 22 | Now startup your favority X test server (like Xephyr) eg `Xephyr -ac :1`. Set the DISPLAY environment variable to :1 with the command `export DISPLAY=:1`. Now you can start trinity shell java -jar bootstrap-0.0.2-SNAPSHOT-jar-with-dependencies.jar`. If you see errors related to libpng, install libpng12 using your distro's package manager. 23 | 24 | You'll still have to start programs from outside Trinity Shell, in command line type "xterm -display :1" and you should see them tiled up next to eachother. That's it! Cheers! If you encounter any problems you can post them in trinity shell or xcb4j respectively. 25 | 26 | ##Branches 27 | 28 | - master: Uses QtJambi (Qt bindings for java) and X. JDK7. 29 | - 0.0.3-SNAPSHOT: Uses JavaFX and X. Based on master. JDK8. 30 | - 0.1.0-SNAPSHOT: Targets wayland, the successor of X. Complete rewrite. JDK8. Further developed [here](https://github.com/Zubnix/westmalle) 31 | -------------------------------------------------------------------------------- /bootstrap/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | /target 5 | /bootstrap.iml 6 | /bin 7 | /pom.xml.releaseBackup 8 | /trinity.log 9 | -------------------------------------------------------------------------------- /bootstrap/src/main/java/org/trinity/bootstrap/EntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Trinity Window Manager and DesktopImpl Shell Copyright (C) 2012 Erik De 3 | * Rijcke This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by the Free 5 | * Software Foundation, either version 3 of the License, or (at your option) any 6 | * later version. This program is distributed in the hope that it will be 7 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 9 | * Public License for more details. You should have received a copy of the GNU 10 | * General Public License along with this program. If not, see 11 | * . 12 | */ 13 | package org.trinity.bootstrap; 14 | 15 | import org.apache.onami.autobind.configuration.StartupModule; 16 | import org.apache.onami.autobind.scanner.PackageFilter; 17 | import org.apache.onami.autobind.scanner.asm.ASMClasspathScanner; 18 | import org.trinity.foundation.render.qt.impl.RenderApplication; 19 | import org.trinity.shell.api.plugin.ShellPluginsRunner; 20 | 21 | import xcb4j.LibXcbLoader; 22 | 23 | import com.google.inject.Guice; 24 | import com.google.inject.Injector; 25 | import com.google.inject.Stage; 26 | 27 | 28 | public class EntryPoint { 29 | 30 | public static void main(final String[] args) { 31 | 32 | LibXcbLoader.load(); 33 | RenderApplication.start(); 34 | 35 | final Injector injector = Guice.createInjector( Stage.PRODUCTION, 36 | StartupModule.create(ASMClasspathScanner.class, 37 | PackageFilter.create("org.trinity"))); 38 | 39 | final ShellPluginsRunner shellPluginsRunner = injector.getInstance(ShellPluginsRunner.class); 40 | shellPluginsRunner.startAll(); 41 | 42 | } 43 | } -------------------------------------------------------------------------------- /bootstrap/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | trinity.log 5 | true 6 | 7 | %d [%thread] %-5level %logger{35} - %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /foundation/.gitignore: -------------------------------------------------------------------------------- 1 | /.project 2 | /.settings 3 | /pom.xml.releaseBackup 4 | -------------------------------------------------------------------------------- /foundation/api/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.settings 3 | /.classpath 4 | /.project 5 | /bin 6 | /pom.xml.releaseBackup 7 | -------------------------------------------------------------------------------- /foundation/api/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | foundation 5 | org.trinity 6 | 0.0.2 7 | 8 | 4.0.0 9 | foundation.api 10 | Foundation API 11 | bundle 12 | 13 | 14 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/DisplayArea.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display; 21 | 22 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 23 | import org.trinity.foundation.api.shared.ExecutionContext; 24 | 25 | import javax.annotation.concurrent.ThreadSafe; 26 | 27 | /** 28 | * Describes a visible part of the screen. It is the base interface of all 29 | * objects wishing to describe an on-screen surface. 30 | *

31 | * Implementation advice: 32 | *

33 | * DisplayArea implementations should have a corresponding 34 | * {@link DisplayAreaManipulator} to provide interaction. 35 | * 36 | * 37 | */ 38 | @Deprecated 39 | @ExecutionContext(DisplayExecutor.class) 40 | @ThreadSafe 41 | public interface DisplayArea { 42 | 43 | } 44 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/DisplaySurfaceFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display; 21 | 22 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 23 | import org.trinity.foundation.api.shared.ExecutionContext; 24 | 25 | import javax.annotation.concurrent.NotThreadSafe; 26 | 27 | /*************************************** 28 | * Creates {@link DisplaySurface}s based on their {@link DisplaySurfaceHandle}. 29 | * Multiple calls to {@link #createDisplaySurface(DisplaySurfaceHandle)} 30 | * with the same {@link DisplaySurfaceHandle} arguments do not necessarily return the same 31 | * {@link DisplaySurface} instances. 32 | * 33 | *************************************** 34 | */ 35 | @ExecutionContext(DisplayExecutor.class) 36 | @NotThreadSafe 37 | public interface DisplaySurfaceFactory { 38 | 39 | // FIXME this should also return a future. the display surface creation 40 | // should be done in the Display thread. 41 | /*************************************** 42 | * Create a new {@link DisplaySurface} with the provided 43 | * {@link DisplaySurfaceHandle} as reference to the underlying native 44 | * resource. 45 | * 46 | * @param displaySurfaceHandle 47 | * a {@link DisplaySurfaceHandle} 48 | * @return a {@link DisplaySurface}. 49 | *************************************** 50 | */ 51 | DisplaySurface createDisplaySurface(DisplaySurfaceHandle displaySurfaceHandle); 52 | } 53 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/DisplaySurfaceHandle.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display; 21 | 22 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 23 | import org.trinity.foundation.api.shared.ExecutionContext; 24 | 25 | import javax.annotation.concurrent.ThreadSafe; 26 | 27 | /*************************************** 28 | * Wraps a native handle to an underlying native display resource. Access to the 29 | * native handle is done by calling {@link #getNativeHandle()}. 30 | * 31 | *************************************** 32 | */ 33 | @ExecutionContext(DisplayExecutor.class) 34 | @ThreadSafe 35 | public interface DisplaySurfaceHandle { 36 | 37 | /*************************************** 38 | * The wrapped native display resource handle. 39 | * 40 | * @return An object, implementation dependent but usually an 41 | * {@link Integer} . 42 | *************************************** 43 | */ 44 | Object getNativeHandle(); 45 | } 46 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/Module.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.api.display; 22 | 23 | import java.util.concurrent.Executors; 24 | import java.util.concurrent.ThreadFactory; 25 | 26 | import org.apache.onami.autobind.annotations.GuiceModule; 27 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 28 | 29 | import com.google.common.util.concurrent.ListeningExecutorService; 30 | import com.google.common.util.concurrent.MoreExecutors; 31 | import com.google.inject.AbstractModule; 32 | 33 | @GuiceModule 34 | class Module extends AbstractModule { 35 | @Override 36 | protected void configure() { 37 | bind(ListeningExecutorService.class).annotatedWith(DisplayExecutor.class) 38 | .toInstance(MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor(new ThreadFactory() { 39 | @Override 40 | public Thread newThread(final Runnable executorRunnable) { 41 | return new Thread( executorRunnable, 42 | "display-executor"); 43 | } 44 | }))); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/Screen.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.api.display; 22 | 23 | import javax.annotation.concurrent.ThreadSafe; 24 | import javax.inject.Singleton; 25 | 26 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 27 | import org.trinity.foundation.api.shared.ExecutionContext; 28 | import org.trinity.foundation.api.shared.Size; 29 | 30 | /** 31 | * The logical screen of a {@link Display}. 32 | */ 33 | @ExecutionContext(DisplayExecutor.class) 34 | @ThreadSafe 35 | public interface Screen { 36 | 37 | /** 38 | * The current size of the screen. 39 | * 40 | * @return size in pixels. 41 | */ 42 | Size getSize(); 43 | } 44 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/bindkey/DisplayExecutor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display.bindkey; 21 | 22 | import com.google.common.util.concurrent.ListeningExecutorService; 23 | import com.google.inject.BindingAnnotation; 24 | import org.trinity.foundation.api.shared.ExecutionContext; 25 | 26 | import javax.inject.Singleton; 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.Target; 29 | 30 | import static java.lang.annotation.ElementType.FIELD; 31 | import static java.lang.annotation.ElementType.METHOD; 32 | import static java.lang.annotation.ElementType.PARAMETER; 33 | import static java.lang.annotation.ElementType.TYPE; 34 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 35 | 36 | /** 37 | * Used for the 'Display' {@link ExecutionContext}. A {@link Singleton} 38 | * {@link ListeningExecutorService} with this key is provided by the 39 | * org.trinity.foundation.api.display package. 40 | */ 41 | @BindingAnnotation 42 | @Target({ TYPE, FIELD, PARAMETER, METHOD }) 43 | @Retention(RUNTIME) 44 | public @interface DisplayExecutor { 45 | 46 | } 47 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/CreationNotify.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.api.display.event; 22 | 23 | import javax.annotation.Nonnull; 24 | import javax.annotation.concurrent.Immutable; 25 | import javax.inject.Singleton; 26 | 27 | import org.trinity.foundation.api.display.Display; 28 | import org.trinity.foundation.api.display.DisplaySurface; 29 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 30 | import org.trinity.foundation.api.shared.ExecutionContext; 31 | 32 | /** 33 | * Signals the {@link Display} {@link Singleton} that a new client 34 | * {@link DisplaySurface} is available. 35 | */ 36 | @Immutable 37 | @ExecutionContext(DisplayExecutor.class) 38 | public class CreationNotify extends DisplayEvent { 39 | private final DisplaySurface displaySurface; 40 | 41 | public CreationNotify(@Nonnull final DisplaySurface displaySurface) { 42 | this.displaySurface = displaySurface; 43 | } 44 | 45 | public DisplaySurface getDisplaySurface() { 46 | return this.displaySurface; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/DestroyNotify.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display.event; 21 | 22 | import org.trinity.foundation.api.display.DisplaySurface; 23 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 24 | import org.trinity.foundation.api.shared.ExecutionContext; 25 | 26 | import javax.annotation.concurrent.Immutable; 27 | 28 | /*************************************** 29 | * Indicates that a {@link DisplaySurface} has been destroyed. 30 | * 31 | *************************************** 32 | */ 33 | @Immutable 34 | @ExecutionContext(DisplayExecutor.class) 35 | public class DestroyNotify extends DisplayEvent { 36 | 37 | } -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/DisplayEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display.event; 21 | 22 | import javax.annotation.concurrent.Immutable; 23 | 24 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | 27 | /** 28 | * The general superclass for all display related events. 29 | */ 30 | @Immutable 31 | @ExecutionContext(DisplayExecutor.class) 32 | public class DisplayEvent { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/FocusGainNotify.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display.event; 21 | 22 | import org.trinity.foundation.api.display.DisplaySurface; 23 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 24 | import org.trinity.foundation.api.shared.ExecutionContext; 25 | 26 | import javax.annotation.concurrent.Immutable; 27 | 28 | /*************************************** 29 | * Indicates that a {@link DisplaySurface} has gained input focus. 30 | * 31 | *************************************** 32 | */ 33 | @Immutable 34 | @ExecutionContext(DisplayExecutor.class) 35 | public class FocusGainNotify extends FocusNotify { 36 | 37 | } -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/FocusLostNotify.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display.event; 21 | 22 | import org.trinity.foundation.api.display.DisplaySurface; 23 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 24 | import org.trinity.foundation.api.shared.ExecutionContext; 25 | 26 | import javax.annotation.concurrent.Immutable; 27 | 28 | /*************************************** 29 | * Indicates that a {@link DisplaySurface} has lost input focus. 30 | * 31 | *************************************** 32 | */ 33 | @Immutable 34 | @ExecutionContext(DisplayExecutor.class) 35 | public class FocusLostNotify extends FocusNotify { 36 | 37 | } -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/FocusNotify.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display.event; 21 | 22 | import javax.annotation.concurrent.Immutable; 23 | 24 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | 27 | /**************************************** 28 | * A generic abstract class for focus related events. 29 | * 30 | *************************************** 31 | */ 32 | @Immutable 33 | @ExecutionContext(DisplayExecutor.class) 34 | public class FocusNotify extends DisplayEvent { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/HideNotify.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display.event; 21 | 22 | import org.trinity.foundation.api.display.DisplaySurface; 23 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 24 | import org.trinity.foundation.api.shared.ExecutionContext; 25 | 26 | import javax.annotation.concurrent.Immutable; 27 | 28 | /** 29 | * Notifies when a {@link DisplaySurface} is made invisible. 30 | * 31 | */ 32 | @Immutable 33 | @ExecutionContext(DisplayExecutor.class) 34 | public class HideNotify extends DisplayEvent { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/PointerEnterNotify.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display.event; 21 | 22 | import javax.annotation.concurrent.Immutable; 23 | 24 | import org.trinity.foundation.api.display.DisplaySurface; 25 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 26 | import org.trinity.foundation.api.shared.ExecutionContext; 27 | 28 | /*************************************** 29 | * Indicates when a pointer device has entered a {@link DisplaySurface}. 30 | * 31 | *************************************** 32 | */ 33 | @Immutable 34 | @ExecutionContext(DisplayExecutor.class) 35 | public class PointerEnterNotify extends PointerVisitationNotify { 36 | 37 | } 38 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/PointerLeaveNotify.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display.event; 21 | 22 | import org.trinity.foundation.api.display.DisplaySurface; 23 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 24 | import org.trinity.foundation.api.shared.ExecutionContext; 25 | 26 | import javax.annotation.concurrent.Immutable; 27 | 28 | /*************************************** 29 | * Indicates when a pointer device has left a {@link DisplaySurface}. 30 | * 31 | *************************************** 32 | */ 33 | @Immutable 34 | @ExecutionContext(DisplayExecutor.class) 35 | public class PointerLeaveNotify extends PointerVisitationNotify { 36 | 37 | } 38 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/PointerVisitationNotify.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display.event; 21 | 22 | import javax.annotation.concurrent.Immutable; 23 | 24 | import org.trinity.foundation.api.display.DisplaySurface; 25 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 26 | import org.trinity.foundation.api.shared.ExecutionContext; 27 | 28 | /**************************************** 29 | * Indicates when a pointer device has crossed the boundary of a 30 | * {@link DisplaySurface}. 31 | * 32 | *************************************** 33 | */ 34 | @Immutable 35 | @ExecutionContext(DisplayExecutor.class) 36 | public class PointerVisitationNotify extends DisplayEvent { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/ShowNotify.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display.event; 21 | 22 | import org.trinity.foundation.api.display.DisplaySurface; 23 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 24 | import org.trinity.foundation.api.shared.ExecutionContext; 25 | 26 | import javax.annotation.concurrent.Immutable; 27 | 28 | /*************************************** 29 | * Notifies that a {@link DisplaySurface} has become visible. 30 | *************************************** 31 | */ 32 | @Immutable 33 | @ExecutionContext(DisplayExecutor.class) 34 | public class ShowNotify extends DisplayEvent { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/ShowRequest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display.event; 21 | 22 | import org.trinity.foundation.api.display.DisplaySurface; 23 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 24 | import org.trinity.foundation.api.shared.ExecutionContext; 25 | 26 | import javax.annotation.concurrent.Immutable; 27 | 28 | /**************************************** 29 | * A request to make a {@link DisplaySurface} visible. 30 | *************************************** 31 | */ 32 | @Immutable 33 | @ExecutionContext(DisplayExecutor.class) 34 | public class ShowRequest extends DisplayEvent { 35 | 36 | } -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/StackingChangedNotify.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.display.event; 21 | 22 | import org.trinity.foundation.api.display.DisplaySurface; 23 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 24 | import org.trinity.foundation.api.shared.ExecutionContext; 25 | 26 | import javax.annotation.concurrent.Immutable; 27 | 28 | /*************************************** 29 | * Notifies that the stacking of a {@link DisplaySurface} has changed 30 | *************************************** 31 | */ 32 | @Immutable 33 | @ExecutionContext(DisplayExecutor.class) 34 | public class StackingChangedNotify extends DisplayEvent { 35 | 36 | } -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/event/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Events used by the foundation display API to communicate the state of the 3 | * display server. 4 | */ 5 | package org.trinity.foundation.api.display.event; -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/display/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Defines display server communication and manipulation. 3 | */ 4 | package org.trinity.foundation.api.display; -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/Painter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.render; 21 | 22 | import org.trinity.foundation.api.display.DisplayArea; 23 | import org.trinity.foundation.api.display.DisplayAreaManipulator; 24 | import org.trinity.foundation.api.display.DisplaySurface; 25 | import org.trinity.foundation.api.render.bindkey.RenderExecutor; 26 | import org.trinity.foundation.api.shared.ExecutionContext; 27 | 28 | import com.google.common.util.concurrent.ListenableFuture; 29 | 30 | /**************************************** 31 | * Talks to a paint back-end and manipulates the geometry of the view model it is 32 | * bound to. A painter is created through the {@link PainterFactory}. 33 | *************************************** 34 | */ 35 | 36 | @Deprecated 37 | @ExecutionContext(RenderExecutor.class) 38 | public interface Painter extends DisplayAreaManipulator { 39 | 40 | /** 41 | * 42 | * Get the {@link DisplaySurface} that the render back-end uses to paint the 43 | * view on. 44 | * 45 | * @return A future {@link DisplaySurface}. 46 | */ 47 | @Deprecated 48 | ListenableFuture getDislaySurface(); 49 | 50 | /*************************************** 51 | * Bind the render toolkit specific view to the {@link DisplayArea} of the 52 | * {@code Painter}. 53 | *************************************** 54 | */ 55 | @Deprecated 56 | ListenableFuture bindView(); 57 | } 58 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/PainterFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.render; 21 | 22 | import org.trinity.foundation.api.shared.AsyncListenable; 23 | 24 | import com.google.common.util.concurrent.ListeningExecutorService; 25 | 26 | //TODO documentation 27 | /*************************************** 28 | * Creates new {@link Painter} delegates for a view model. 29 | * 30 | *************************************** 31 | */ 32 | @Deprecated 33 | public interface PainterFactory { 34 | 35 | // FIXME this should return a future. painter creation should be done on the 36 | // Render thread. 37 | /** 38 | * Creates a new {@code Painter} for the given view model. Multiple calls 39 | * with the same model should create a new {@code Painter} instance each 40 | * time. 41 | * 42 | * @param viewModel 43 | * The view model that the created {@code Painter} will use as a 44 | * visual base. 45 | * @return a new {@link Painter} 46 | */ 47 | Painter createPainter( ListeningExecutorService viewModelExecutor, 48 | final AsyncListenable viewModel); 49 | } 50 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/binding/model/ViewReference.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.render.binding.model; 21 | 22 | import java.lang.annotation.ElementType; 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.RetentionPolicy; 25 | import java.lang.annotation.Target; 26 | 27 | import com.google.common.util.concurrent.ListeningExecutorService; 28 | import org.trinity.foundation.api.render.binding.Binder; 29 | 30 | /*************************************** 31 | * Marks a method as the getter of the view of a model. 32 | * 33 | * @see Binder#bind(ListeningExecutorService, Object, Object) 34 | *************************************** 35 | */ 36 | @Retention(RetentionPolicy.RUNTIME) 37 | @Target({ ElementType.METHOD }) 38 | public @interface ViewReference { 39 | 40 | } -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/binding/package-info.java: -------------------------------------------------------------------------------- 1 | // TODO extensive documentation on how to use the binding api. 2 | /** 3 | * A basic model 4 | * view - viewmodel pattern. It offers the following bindings between a 5 | * viewmodel, which can be any type of object, and view, usually of type 6 | * {@link org.trinity.foundation.api.render.binding.view.View}. 7 | *

8 | * View bindings: 9 | *

16 | *

17 | * Model bindings: 18 | *

23 | */ 24 | package org.trinity.foundation.api.render.binding; -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/binding/view/DefaultPropertyAdapter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.render.binding.view; 21 | 22 | import org.trinity.foundation.api.render.bindkey.RenderExecutor; 23 | import org.trinity.foundation.api.shared.ExecutionContext; 24 | 25 | import javax.annotation.Nullable; 26 | 27 | /*************************************** 28 | * A default implementation of a {@link PropertyAdapter}. It simply returns the 29 | * property value without modification. Used as the default value in 30 | * {@link PropertySlot#adapter()}. 31 | * 32 | *************************************** 33 | */ 34 | @ExecutionContext(RenderExecutor.class) 35 | public class DefaultPropertyAdapter implements PropertyAdapter { 36 | 37 | @Override 38 | public Object adapt(@Nullable final Object property) { 39 | return property; 40 | } 41 | } -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/binding/view/EventSignal.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.render.binding.view; 21 | 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | import org.trinity.foundation.api.render.binding.view.delegate.Signal; 27 | 28 | /*************************************** 29 | * Mark a view as a producer of listenable events. It's up to the 30 | * {@link EventSignalFilter} to make sure the correct event listeners are 31 | * installed and the {@link Signal} is fired when an event arrives. 32 | *

33 | * An {@link EventSignal} is used as an argument of {@link EventSignals}. 34 | * 35 | * @see Signal 36 | *************************************** 37 | */ 38 | @Retention(RetentionPolicy.RUNTIME) 39 | @Target({}) 40 | public @interface EventSignal { 41 | 42 | /*************************************** 43 | * The name of the no-args model method that should be invoked when an event 44 | * arrives. 45 | * 46 | * @return a method name. 47 | *************************************** 48 | */ 49 | String name(); 50 | 51 | /** 52 | * The type {@link EventSignalFilter} that will be used to listen for view 53 | * events. 54 | * 55 | * @return 56 | */ 57 | Class filter(); 58 | 59 | } 60 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/binding/view/EventSignalFilter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.api.render.binding.view; 22 | 23 | import org.trinity.foundation.api.render.binding.view.delegate.Signal; 24 | 25 | import javax.annotation.Nonnull; 26 | 27 | /** 28 | * A filter for view events. An event signal filter is used to listen to a 29 | * specific view event. When the event arrives, the given {@link Signal} should 30 | * be {@link Signal#fire()}d. An event signal filter should not keep any state 31 | * as creation and destruction of the filter is undefined. 32 | */ 33 | public interface EventSignalFilter { 34 | 35 | void installFilter( @Nonnull Object view, 36 | @Nonnull Signal signal); 37 | } 38 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/binding/view/EventSignals.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.render.binding.view; 21 | 22 | import java.lang.annotation.ElementType; 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.RetentionPolicy; 25 | import java.lang.annotation.Target; 26 | 27 | /*************************************** 28 | * Groups all installed {@link EventSignal}s of a view. 29 | *************************************** 30 | */ 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Target({ ElementType.TYPE, ElementType.FIELD }) 33 | public @interface EventSignals { 34 | /*************************************** 35 | * All {@code EventSignal}s present on a view element. 36 | * 37 | * @return {@link EventSignal}s 38 | *************************************** 39 | */ 40 | EventSignal[] value(); 41 | } 42 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/binding/view/ObservableCollection.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.render.binding.view; 21 | 22 | import java.lang.annotation.ElementType; 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.RetentionPolicy; 25 | import java.lang.annotation.Target; 26 | 27 | import org.trinity.foundation.api.render.binding.view.delegate.ChildViewDelegate; 28 | 29 | /*************************************** 30 | * Bind every child view of the marked view to the respective element of the 31 | * referenced collection. Correctly handling these child views is delegated to 32 | * the {@link ChildViewDelegate}. 33 | *************************************** 34 | */ 35 | @Retention(RetentionPolicy.RUNTIME) 36 | @Target({ ElementType.FIELD, ElementType.TYPE }) 37 | public @interface ObservableCollection { 38 | 39 | /*************************************** 40 | * The referenced collection property. Valid collection types are 41 | * implementation dependent. 42 | * 43 | * @return a property name. 44 | *************************************** 45 | */ 46 | String value(); 47 | 48 | /*************************************** 49 | * The child view class to use when instantiating a new child view. This can 50 | * be any view class that can be instantiated by Guice. 51 | * 52 | * @return a view type. 53 | *************************************** 54 | */ 55 | Class view(); 56 | } -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/binding/view/PropertyAdapter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.render.binding.view; 21 | 22 | import javax.annotation.Nullable; 23 | 24 | /*************************************** 25 | * Transforms a model property value to one or more other values so it can be 26 | * used to invoke a view method. To transform to multiple different types of 27 | * objects, simply return an array of objects containing the values in same 28 | * order as the view method arguments. 29 | * 30 | * @see PropertySlot 31 | *************************************** 32 | */ 33 | public interface PropertyAdapter { 34 | 35 | /*************************************** 36 | * Transforms a model property value to one or more other values. 37 | * 38 | * @param property 39 | * A model property 40 | * @return the transformatin. 41 | *************************************** 42 | */ 43 | Object adapt(@Nullable T property); 44 | } 45 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/binding/view/PropertySlots.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.render.binding.view; 21 | 22 | import java.lang.annotation.ElementType; 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.RetentionPolicy; 25 | import java.lang.annotation.Target; 26 | 27 | /*************************************** 28 | * Groups all {@link PropertySlot}s installed on a view. 29 | *************************************** 30 | */ 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Target({ ElementType.TYPE, ElementType.FIELD }) 33 | public @interface PropertySlots { 34 | 35 | /*************************************** 36 | * The installed {@link PropertySlot}s on the view. 37 | * 38 | * @return {@link PropertySlot}s 39 | *************************************** 40 | */ 41 | PropertySlot[] value(); 42 | } -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/binding/view/delegate/Signal.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.render.binding.view.delegate; 21 | 22 | import com.google.common.util.concurrent.ListenableFuture; 23 | 24 | /** 25 | * ************************************ 26 | * A convenience service to call a method used as an event signal slot based on 27 | * widget toolkit specific events. 28 | *

29 | * ************************************** 30 | */ 31 | public interface Signal { 32 | 33 | ListenableFuture fire(); 34 | } 35 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/binding/view/delegate/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Delegates & helper classes for interaction with an external widget toolkit. 3 | */ 4 | package org.trinity.foundation.api.render.binding.view.delegate; -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/binding/view/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * View related bindings and helper classes. 3 | */ 4 | package org.trinity.foundation.api.render.binding.view; -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/bindkey/RenderExecutor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.api.render.bindkey; 22 | 23 | import static java.lang.annotation.ElementType.FIELD; 24 | import static java.lang.annotation.ElementType.METHOD; 25 | import static java.lang.annotation.ElementType.PARAMETER; 26 | import static java.lang.annotation.ElementType.TYPE; 27 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 28 | 29 | import java.lang.annotation.Retention; 30 | import java.lang.annotation.Target; 31 | 32 | import javax.inject.Singleton; 33 | 34 | import org.trinity.foundation.api.shared.ExecutionContext; 35 | 36 | import com.google.common.util.concurrent.ListeningExecutorService; 37 | import com.google.inject.BindingAnnotation; 38 | 39 | /** 40 | * Used for the 'Render' {@link ExecutionContext}. A 41 | * {@link ListeningExecutorService} {@link Singleton} instance is not provided 42 | * by the render API and should be exposed by the implementation package. 43 | */ 44 | @BindingAnnotation 45 | @Target({ TYPE, FIELD, PARAMETER, METHOD }) 46 | @Retention(RUNTIME) 47 | public @interface RenderExecutor { 48 | } 49 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/render/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Defines a simple high-level API for rendering a scene. The most 3 | * straightforward way of using this api is to {@link com.google.inject.Inject} 4 | * a {@link org.trinity.foundation.api.render.PainterFactory} in a view model 5 | * and create a {@link org.trinity.foundation.api.render.Painter}. The next step 6 | * is to let the {@code Painter} know which 7 | * {@link org.trinity.foundation.api.render.binding.view.View} object to use for 8 | * this model. A model's view is an injected instance of type {@code View} that 9 | * implements an existing widget from a 3rd party toolkit, enriched with 10 | * additional binding annotations found in the 11 | * org.trinity.foundation.api.render.binding package. The view can then be 12 | * exposed to the painter by annotating the view getter with 13 | * {@link org.trinity.foundation.api.render.binding.model.ViewReference} in the 14 | * model class. Finally, everything is glued together by calling 15 | * {@link org.trinity.foundation.api.render.Painter#bindView()}. 16 | *

17 | * {@code Painter} is also used to change the elements visual geometry through 18 | * it's inherited 19 | * {@link org.trinity.foundation.api.display.DisplayAreaManipulator} methods. 20 | *

21 | * A scene can also be directly updated by passing a 22 | * {@link org.trinity.foundation.api.render.PaintRoutine} to a 23 | * {@link org.trinity.foundation.api.render.PaintRenderer}. Optionally, the 24 | * {@code PaintRenderer} capabilities can be extended by extending 25 | * {@link org.trinity.foundation.api.render.PaintContext}. 26 | */ 27 | package org.trinity.foundation.api.render; -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/shared/ExecutionContext.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.api.shared; 22 | 23 | import java.lang.annotation.Annotation; 24 | import java.lang.annotation.Documented; 25 | import java.lang.annotation.ElementType; 26 | import java.lang.annotation.Inherited; 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | 31 | import com.google.common.util.concurrent.ListeningExecutorService; 32 | 33 | /** 34 | * Marks an object as belonging to an execution context, making it "thread" 35 | * confined to said execution context. 36 | */ 37 | @Documented 38 | @Retention(RetentionPolicy.RUNTIME) 39 | @Target(value = ElementType.TYPE) 40 | @Inherited 41 | public @interface ExecutionContext { 42 | 43 | /** 44 | * The Guice binding key used to retrieve the 45 | * {@link ListeningExecutorService} where execution for this object will 46 | * take place. 47 | * 48 | * @return 49 | */ 50 | Class value(); 51 | } 52 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/shared/Rectangle.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.api.shared; 21 | 22 | /*************************************** 23 | * A 2 dimensional rectangle with a position and a dimension. 24 | * 25 | *************************************** 26 | */ 27 | public interface Rectangle { 28 | 29 | Coordinate getPosition(); 30 | 31 | Size getSize(); 32 | } 33 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/shared/Size.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.api.shared; 22 | 23 | import javax.annotation.Nonnegative; 24 | import javax.annotation.concurrent.Immutable; 25 | 26 | @Immutable 27 | public class Size { 28 | 29 | private final int width, height; 30 | 31 | public Size(@Nonnegative final int width, 32 | @Nonnegative final int height) { 33 | this.width = width; 34 | this.height = height; 35 | } 36 | 37 | public int getWidth() { 38 | return this.width; 39 | } 40 | 41 | public int getHeight() { 42 | return this.height; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /foundation/api/src/main/java/org/trinity/foundation/api/shared/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * General useful classes and objects. 3 | */ 4 | package org.trinity.foundation.api.shared; -------------------------------------------------------------------------------- /foundation/api/src/test/java/org/trinity/foundation/api/shared/AsyncListenableEventBusTest.java: -------------------------------------------------------------------------------- 1 | package org.trinity.foundation.api.shared; 2 | 3 | import java.util.concurrent.CountDownLatch; 4 | import java.util.concurrent.Executors; 5 | import java.util.concurrent.TimeUnit; 6 | 7 | import org.junit.Assert; 8 | import org.junit.Test; 9 | 10 | import com.google.common.eventbus.Subscribe; 11 | 12 | public class AsyncListenableEventBusTest { 13 | 14 | @Test 15 | public void test() throws InterruptedException { 16 | final CountDownLatch countDownLatchAll = new CountDownLatch(6); 17 | 18 | final AsyncListenableEventBus asyncListenableEventBus = new AsyncListenableEventBus(Executors.newSingleThreadExecutor()); 19 | 20 | asyncListenableEventBus.register( new Object() { 21 | @Subscribe 22 | public void handle(final Object event) { 23 | countDownLatchAll.countDown(); 24 | countDownLatchAll.countDown(); 25 | } 26 | }, 27 | Executors.newSingleThreadExecutor()); 28 | 29 | asyncListenableEventBus.register( new Object() { 30 | @Subscribe 31 | public void handle(final Object event) { 32 | countDownLatchAll.countDown(); 33 | } 34 | }, 35 | Executors.newSingleThreadExecutor()); 36 | 37 | asyncListenableEventBus.post(new Object()); 38 | asyncListenableEventBus.post(new Object()); 39 | 40 | final boolean notimeout = countDownLatchAll.await( 1, 41 | TimeUnit.SECONDS); 42 | 43 | Assert.assertTrue(notimeout); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /foundation/display.x11.api/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | foundation 6 | org.trinity 7 | 0.0.2 8 | 9 | 10 | foundation.display.x11.api 11 | Foundation Implementation X Display API 12 | bundle 13 | 14 | 15 | 16 | org.trinity 17 | XCB4J 18 | 0.0.1 19 | 20 | 21 | org.trinity 22 | foundation.api 23 | ${project.version} 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /foundation/display.x11.api/src/main/java/org/trinity/foundation/display/x11/api/Module.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.display.x11.api; 22 | 23 | import org.apache.onami.autobind.annotations.GuiceModule; 24 | import org.trinity.foundation.display.x11.api.bindkey.XEventBus; 25 | 26 | import com.google.common.eventbus.EventBus; 27 | import com.google.inject.AbstractModule; 28 | 29 | @GuiceModule 30 | class Module extends AbstractModule { 31 | @Override 32 | protected void configure() { 33 | bind(EventBus.class).annotatedWith(XEventBus.class).toInstance(new EventBus()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /foundation/display.x11.api/src/main/java/org/trinity/foundation/display/x11/api/XConnection.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.display.x11.api; 22 | 23 | import java.io.Closeable; 24 | 25 | import javax.annotation.Nonnegative; 26 | import javax.annotation.Nonnull; 27 | import javax.annotation.concurrent.NotThreadSafe; 28 | 29 | import org.freedesktop.xcb.SWIGTYPE_p_xcb_connection_t; 30 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 31 | import org.trinity.foundation.api.shared.ExecutionContext; 32 | 33 | import com.google.common.base.Optional; 34 | 35 | /** 36 | * A connection to an X display server. 37 | */ 38 | @NotThreadSafe 39 | @ExecutionContext(DisplayExecutor.class) 40 | public interface XConnection extends Closeable { 41 | /** 42 | * The XCB connection reference. The optional reference will be absent if no 43 | * connection is present. 44 | * 45 | * @return 46 | */ 47 | Optional getConnectionReference(); 48 | 49 | /** 50 | * Open a connection to an X display server. 51 | * 52 | * @param displayName 53 | * The display to connect to. 54 | * @param screen 55 | * The screen of the display to connect to. 56 | */ 57 | void open( @Nonnull String displayName, 58 | @Nonnegative int screen); 59 | 60 | /** 61 | * Close the connection to the underlying X display server. 62 | */ 63 | @Override 64 | void close(); 65 | } 66 | -------------------------------------------------------------------------------- /foundation/display.x11.api/src/main/java/org/trinity/foundation/display/x11/api/XScreen.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.display.x11.api; 22 | 23 | import javax.annotation.concurrent.NotThreadSafe; 24 | 25 | import org.freedesktop.xcb.xcb_screen_t; 26 | import org.trinity.foundation.api.display.Screen; 27 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 28 | import org.trinity.foundation.api.shared.ExecutionContext; 29 | 30 | @ExecutionContext(DisplayExecutor.class) 31 | @NotThreadSafe 32 | public interface XScreen extends Screen { 33 | xcb_screen_t getScreenReference(); 34 | } 35 | -------------------------------------------------------------------------------- /foundation/display.x11.api/src/main/java/org/trinity/foundation/display/x11/api/XWindowCache.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.display.x11.api; 22 | 23 | import org.trinity.foundation.api.display.DisplaySurface; 24 | 25 | /** 26 | * Caches {@link DisplaySurface} instances to their X window id. 27 | */ 28 | public interface XWindowCache { 29 | /** 30 | * Return the {@link DisplaySurface} with the given X window id. If no 31 | * display surface is present, a new one will be created. 32 | * 33 | * @param windowId 34 | * @return 35 | */ 36 | DisplaySurface getWindow(final int windowId); 37 | 38 | /** 39 | * Check if the {@link DisplaySurface} with the given X window id is present in the cache. 40 | * @param windowId 41 | * @return 42 | */ 43 | boolean isPresent(final int windowId); 44 | } 45 | -------------------------------------------------------------------------------- /foundation/display.x11.api/src/main/java/org/trinity/foundation/display/x11/api/bindkey/XEventBus.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.display.x11.api.bindkey; 22 | 23 | import static java.lang.annotation.ElementType.FIELD; 24 | import static java.lang.annotation.ElementType.METHOD; 25 | import static java.lang.annotation.ElementType.PARAMETER; 26 | import static java.lang.annotation.ElementType.TYPE; 27 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 28 | 29 | import java.lang.annotation.Retention; 30 | import java.lang.annotation.Target; 31 | 32 | import javax.inject.Singleton; 33 | 34 | import com.google.common.eventbus.EventBus; 35 | import com.google.inject.BindingAnnotation; 36 | 37 | /** 38 | * Used for the X {@link EventBus} {@link Singleton}. An instance is provided by 39 | * org.trinity.foundation.display.x11.api package. 40 | */ 41 | @BindingAnnotation 42 | @Target({ TYPE, FIELD, PARAMETER, METHOD }) 43 | @Retention(RUNTIME) 44 | public @interface XEventBus { 45 | } 46 | -------------------------------------------------------------------------------- /foundation/display.x11.impl/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | /target 5 | /display.iml 6 | /bin 7 | /pom.xml.releaseBackup 8 | -------------------------------------------------------------------------------- /foundation/display.x11.impl/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | 6 | foundation 7 | org.trinity 8 | 0.0.2 9 | 10 | 11 | foundation.display.x11.impl 12 | Foundation Implementation X Display Implementation 13 | bundle 14 | 15 | 16 | 17 | org.trinity 18 | foundation.display.x11.api 19 | ${project.version} 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /foundation/display.x11.impl/src/main/java/org/trinity/foundation/display/x11/impl/Module.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.display.x11.impl; 21 | 22 | import org.apache.onami.autobind.annotations.GuiceModule; 23 | import org.trinity.foundation.api.display.DisplaySurface; 24 | import org.trinity.foundation.api.display.DisplaySurfaceFactory; 25 | 26 | import com.google.inject.AbstractModule; 27 | import com.google.inject.assistedinject.FactoryModuleBuilder; 28 | 29 | @GuiceModule 30 | class Module extends AbstractModule { 31 | 32 | @Override 33 | protected void configure() { 34 | install(new FactoryModuleBuilder().implement( DisplaySurface.class, 35 | XWindow.class).build(DisplaySurfaceFactory.class)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /foundation/display.x11.impl/src/main/java/org/trinity/foundation/display/x11/impl/XScreenImpl.java: -------------------------------------------------------------------------------- 1 | package org.trinity.foundation.display.x11.impl; 2 | 3 | import org.freedesktop.xcb.xcb_screen_t; 4 | import org.trinity.foundation.api.display.bindkey.DisplayExecutor; 5 | import org.trinity.foundation.api.shared.ExecutionContext; 6 | import org.trinity.foundation.api.shared.Size; 7 | import org.trinity.foundation.display.x11.api.XScreen; 8 | 9 | import javax.annotation.Nonnull; 10 | import javax.annotation.concurrent.Immutable; 11 | 12 | /** 13 | * Created with IntelliJ IDEA. User: erik Date: 7/12/13 Time: 11:28 PM To change 14 | * this template use File | Settings | File Templates. 15 | */ 16 | @Immutable 17 | @ExecutionContext(DisplayExecutor.class) 18 | public class XScreenImpl implements XScreen { 19 | 20 | private final xcb_screen_t screen; 21 | 22 | public XScreenImpl(@Nonnull final xcb_screen_t screen) { 23 | this.screen = screen; 24 | } 25 | 26 | @Override 27 | public xcb_screen_t getScreenReference() { 28 | return screen; 29 | } 30 | 31 | @Override 32 | public Size getSize() { 33 | return new Size(this.screen.getWidth_in_pixels(), 34 | this.screen.getHeight_in_pixels()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /foundation/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | trinity 5 | org.trinity 6 | 0.0.2 7 | 8 | 9 | 4.0.0 10 | foundation 11 | Foundation 12 | pom 13 | 14 | 15 | api 16 | display.x11.api 17 | display.x11.impl 18 | render.qt.impl 19 | render.binding.impl 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /foundation/render.binding.impl/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /.settings 3 | /.classpath 4 | /.project 5 | /bin 6 | /pom.xml.releaseBackup 7 | -------------------------------------------------------------------------------- /foundation/render.binding.impl/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | org.trinity 6 | foundation 7 | 0.0.2 8 | 9 | 10 | foundation.render.binding.impl 11 | Foundation Render Binding Implementation 12 | bundle 13 | 14 | 15 | 16 | org.trinity 17 | foundation.api 18 | ${project.version} 19 | 20 | 21 | 22 | net.java.dev.glazedlists 23 | glazedlists_java15 24 | 1.8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /foundation/render.binding.impl/src/main/java/org/trinity/foundation/api/render/binding/Module.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.api.render.binding; 22 | 23 | import org.apache.onami.autobind.annotations.GuiceModule; 24 | import org.trinity.foundation.api.render.binding.model.PropertyChanged; 25 | 26 | import com.google.inject.AbstractModule; 27 | import com.google.inject.matcher.Matchers; 28 | 29 | @GuiceModule 30 | class Module extends AbstractModule { 31 | 32 | @Override 33 | protected void configure() { 34 | final PropertyChangedSignalDispatcher viewSignalDispatcher = new PropertyChangedSignalDispatcher(); 35 | requestInjection(viewSignalDispatcher); 36 | bindInterceptor(Matchers.any(), 37 | Matchers.annotatedWith(PropertyChanged.class), 38 | viewSignalDispatcher); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /foundation/render.binding.impl/src/test/java/org/trinity/foundation/api/render/binding/BooleanToStringAdapter.java: -------------------------------------------------------------------------------- 1 | package org.trinity.foundation.api.render.binding; 2 | 3 | import org.trinity.foundation.api.render.binding.view.PropertyAdapter; 4 | 5 | public class BooleanToStringAdapter implements PropertyAdapter { 6 | 7 | @Override 8 | public String adapt(final Boolean property) { 9 | return String.valueOf(property); 10 | } 11 | } -------------------------------------------------------------------------------- /foundation/render.binding.impl/src/test/java/org/trinity/foundation/api/render/binding/CollectionElementView.java: -------------------------------------------------------------------------------- 1 | package org.trinity.foundation.api.render.binding; 2 | 3 | import org.trinity.foundation.api.render.binding.view.EventSignal; 4 | import org.trinity.foundation.api.render.binding.view.EventSignalFilter; 5 | import org.trinity.foundation.api.render.binding.view.EventSignals; 6 | import org.trinity.foundation.api.render.binding.view.PropertySlot; 7 | import org.trinity.foundation.api.render.binding.view.PropertySlots; 8 | 9 | @EventSignals({ @EventSignal(name = "onClick", filter = EventSignalFilter.class) }) 10 | @PropertySlots(@PropertySlot(propertyName = "booleanProperty", methodName = "handleBooleanProperty", argumentTypes = boolean.class)) 11 | public class CollectionElementView { 12 | public void handleBooleanProperty(final boolean booleanProperty) { 13 | 14 | } 15 | 16 | public void handleStringProperty(final String string) { 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /foundation/render.binding.impl/src/test/java/org/trinity/foundation/api/render/binding/DummyExecutor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.api.render.binding; 22 | 23 | public @interface DummyExecutor { 24 | } 25 | -------------------------------------------------------------------------------- /foundation/render.binding.impl/src/test/java/org/trinity/foundation/api/render/binding/DummySubModel.java: -------------------------------------------------------------------------------- 1 | package org.trinity.foundation.api.render.binding; 2 | 3 | import java.util.concurrent.ExecutorService; 4 | 5 | import org.trinity.foundation.api.render.binding.model.PropertyChanged; 6 | import org.trinity.foundation.api.shared.AsyncListenable; 7 | 8 | public class DummySubModel implements AsyncListenable { 9 | 10 | private DummySubSubModel dummySubSubModel = new DummySubSubModel(); 11 | 12 | private boolean booleanProperty; 13 | 14 | @PropertyChanged(value="booleanProperty",executor = DummyExecutor.class) 15 | public void setBooleanProperty(final boolean booleanProperty) { 16 | this.booleanProperty = booleanProperty; 17 | } 18 | 19 | public boolean isBooleanProperty() { 20 | return this.booleanProperty; 21 | } 22 | 23 | public void onClick() { 24 | 25 | } 26 | 27 | public void onKey() { 28 | 29 | } 30 | 31 | @PropertyChanged(value="dummySubSubModel",executor = DummyExecutor.class) 32 | public void setDummySubSubModel(final DummySubSubModel dummySubSubModel) { 33 | this.dummySubSubModel = dummySubSubModel; 34 | } 35 | 36 | public DummySubSubModel getSubSubModel() { 37 | return this.dummySubSubModel; 38 | } 39 | 40 | @Override 41 | public void register(final Object listener) { 42 | // TODO Auto-generated method stub 43 | 44 | } 45 | 46 | @Override 47 | public void register( final Object listener, 48 | final ExecutorService executor) { 49 | // TODO Auto-generated method stub 50 | 51 | } 52 | 53 | @Override 54 | public void unregister(final Object listener) { 55 | // TODO Auto-generated method stub 56 | 57 | } 58 | 59 | @Override 60 | public void post(final Object event) { 61 | // TODO Auto-generated method stub 62 | 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /foundation/render.binding.impl/src/test/java/org/trinity/foundation/api/render/binding/DummySubSubModel.java: -------------------------------------------------------------------------------- 1 | package org.trinity.foundation.api.render.binding; 2 | 3 | import java.util.concurrent.ExecutorService; 4 | 5 | import org.trinity.foundation.api.render.binding.model.PropertyChanged; 6 | import org.trinity.foundation.api.shared.AsyncListenable; 7 | 8 | public class DummySubSubModel implements AsyncListenable { 9 | 10 | private boolean booleanProperty; 11 | 12 | public boolean isBooleanProperty() { 13 | return this.booleanProperty; 14 | } 15 | 16 | @PropertyChanged(value = "booleanProperty", executor = DummyExecutor.class) 17 | public void setBooleanProperty(final boolean booleanProperty) { 18 | this.booleanProperty = booleanProperty; 19 | } 20 | 21 | @Override 22 | public void register(final Object listener) { 23 | // TODO Auto-generated method stub 24 | 25 | } 26 | 27 | @Override 28 | public void register( final Object listener, 29 | final ExecutorService executor) { 30 | // TODO Auto-generated method stub 31 | 32 | } 33 | 34 | @Override 35 | public void unregister(final Object listener) { 36 | // TODO Auto-generated method stub 37 | 38 | } 39 | 40 | @Override 41 | public void post(final Object event) { 42 | // TODO Auto-generated method stub 43 | 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /foundation/render.binding.impl/src/test/java/org/trinity/foundation/api/render/binding/Model.java: -------------------------------------------------------------------------------- 1 | package org.trinity.foundation.api.render.binding; 2 | 3 | import org.trinity.foundation.api.render.binding.model.PropertyChanged; 4 | 5 | import ca.odell.glazedlists.BasicEventList; 6 | import ca.odell.glazedlists.EventList; 7 | 8 | public class Model { 9 | private DummySubModel dummySubModel = new DummySubModel(); 10 | private final DummySubModel otherSubModel = new DummySubModel(); 11 | 12 | private final EventList dummySubModels = new BasicEventList(); 13 | 14 | public Model() { 15 | this.dummySubModels.add(new DummySubModel()); 16 | } 17 | 18 | public DummySubModel getDummySubModel() { 19 | return this.dummySubModel; 20 | } 21 | 22 | @PropertyChanged(value="dummySubModel",executor = DummyExecutor.class) 23 | public void setDummySubModel(final DummySubModel dummySubModel) { 24 | this.dummySubModel = dummySubModel; 25 | } 26 | 27 | public DummySubModel getOtherSubModel() { 28 | return this.otherSubModel; 29 | } 30 | 31 | public EventList getDummySubModels() { 32 | return this.dummySubModels; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /foundation/render.binding.impl/src/test/java/org/trinity/foundation/api/render/binding/SubView.java: -------------------------------------------------------------------------------- 1 | package org.trinity.foundation.api.render.binding; 2 | 3 | import org.trinity.foundation.api.render.binding.view.DataContext; 4 | import org.trinity.foundation.api.render.binding.view.EventSignal; 5 | import org.trinity.foundation.api.render.binding.view.EventSignalFilter; 6 | import org.trinity.foundation.api.render.binding.view.EventSignals; 7 | import org.trinity.foundation.api.render.binding.view.PropertySlot; 8 | import org.trinity.foundation.api.render.binding.view.PropertySlots; 9 | 10 | @DataContext("dummySubModel") 11 | @EventSignals({ @EventSignal(name = "onClick", filter = EventSignalFilter.class) }) 12 | @PropertySlots(@PropertySlot(propertyName = "booleanProperty", methodName = "handleBooleanProperty", argumentTypes = boolean.class)) 13 | public class SubView { 14 | 15 | public void handleBooleanProperty(final boolean booleanProperty) { 16 | 17 | } 18 | 19 | public void handleStringProperty(final String string) { 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /foundation/render.binding.impl/src/test/java/org/trinity/foundation/api/render/binding/View.java: -------------------------------------------------------------------------------- 1 | package org.trinity.foundation.api.render.binding; 2 | 3 | import org.trinity.foundation.api.render.binding.view.DataContext; 4 | import org.trinity.foundation.api.render.binding.view.EventSignal; 5 | import org.trinity.foundation.api.render.binding.view.EventSignalFilter; 6 | import org.trinity.foundation.api.render.binding.view.EventSignals; 7 | import org.trinity.foundation.api.render.binding.view.ObservableCollection; 8 | import org.trinity.foundation.api.render.binding.view.PropertySlot; 9 | import org.trinity.foundation.api.render.binding.view.PropertySlots; 10 | 11 | @ObservableCollection(value = "dummySubModels", view = CollectionElementView.class) 12 | @PropertySlots(@PropertySlot(dataContext = "class", propertyName = "name", methodName = "setClassName", argumentTypes = String.class)) 13 | public class View { 14 | 15 | @DataContext("otherSubModel.subSubModel") 16 | @PropertySlots(@PropertySlot(propertyName = "booleanProperty", methodName = "handleStringProperty", argumentTypes = String.class, adapter = BooleanToStringAdapter.class)) 17 | private SubView mouseInputSubView = new SubView(); 18 | @EventSignals(@EventSignal(name = "onKey", filter = EventSignalFilter.class)) 19 | private SubView keyInputSubView = new SubView(); 20 | private String className; 21 | 22 | public SubView getMouseInputSubView() { 23 | return this.mouseInputSubView; 24 | } 25 | 26 | public void setSubView(final SubView subView) { 27 | this.mouseInputSubView = subView; 28 | } 29 | 30 | public SubView getKeyInputSubView() { 31 | return this.keyInputSubView; 32 | } 33 | 34 | public void setKeyInputSubView(final SubView keyInputSubView) { 35 | this.keyInputSubView = keyInputSubView; 36 | } 37 | 38 | public String getClassName() { 39 | return className; 40 | } 41 | 42 | public void setClassName(final String className) { 43 | this.className = className; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /foundation/render.qt.impl/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /target 3 | /.classpath 4 | /.project 5 | /render.qt.impl.iml 6 | /bin 7 | /pom.xml.releaseBackup 8 | -------------------------------------------------------------------------------- /foundation/render.qt.impl/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | org.trinity 6 | foundation 7 | 0.0.2 8 | 9 | 10 | foundation.render.qt.impl 11 | Foundation Render Qt Jambi Implementation 12 | bundle 13 | 14 | 15 | 16 | qtjambi 17 | qtjambi 18 | http://qtjambi.sourceforge.net/maven2/ 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | net.sf.qtjambi 27 | qtjambi 28 | 29 | 4.6.3.2 30 | 31 | 32 | ${project.groupId} 33 | foundation.api 34 | ${project.version} 35 | 36 | 37 | -------------------------------------------------------------------------------- /foundation/render.qt.impl/src/main/java/org/trinity/foundation/render/qt/impl/RenderApplication.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.render.qt.impl; 21 | 22 | import java.util.concurrent.ExecutorService; 23 | import java.util.concurrent.Executors; 24 | import java.util.concurrent.ThreadFactory; 25 | 26 | import org.slf4j.Logger; 27 | import org.slf4j.LoggerFactory; 28 | 29 | import com.trolltech.qt.gui.QApplication; 30 | 31 | public class RenderApplication extends QApplication { 32 | 33 | private static final Logger logger = LoggerFactory.getLogger(RenderApplication.class); 34 | 35 | public RenderApplication() { 36 | super( "Trinity QtJambi Renderer", 37 | new String[] {}); 38 | } 39 | 40 | private static final ExecutorService qRenderEventPump = Executors.newSingleThreadExecutor(new ThreadFactory() { 41 | 42 | @Override 43 | public Thread newThread(final Runnable r) { 44 | return new Thread( r, 45 | "qtjambi-application"); 46 | } 47 | }); 48 | 49 | public static void start() { 50 | qRenderEventPump.submit(new Runnable() { 51 | @Override 52 | public void run() { 53 | QApplication.initialize(new String[] {}); 54 | QApplication.setQuitOnLastWindowClosed(false); 55 | final int r = QApplication.exec(); 56 | if (r != 0) { 57 | logger.error( "QtJambi render application exited with error code={}", 58 | r); 59 | } 60 | } 61 | }); 62 | while (QApplication.startingUp()) { 63 | Thread.yield(); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /foundation/render.qt.impl/src/main/java/org/trinity/foundation/render/qt/impl/RenderEventConversion.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.render.qt.impl; 21 | 22 | import org.trinity.foundation.api.display.event.DisplayEvent; 23 | 24 | import com.trolltech.qt.core.QEvent; 25 | import com.trolltech.qt.core.QEvent.Type; 26 | import com.trolltech.qt.core.QObject; 27 | 28 | @Deprecated 29 | public interface RenderEventConversion { 30 | DisplayEvent convertEvent( Object view, 31 | QObject eventProducer, 32 | QEvent qEvent); 33 | 34 | Type getQEventType(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /foundation/render.qt.impl/src/main/java/org/trinity/foundation/render/qt/impl/binding/view/delegate/PropertySlotInvocatorDelegateImpl.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.render.qt.impl.binding.view.delegate; 22 | 23 | import java.lang.reflect.Method; 24 | import java.util.concurrent.Callable; 25 | 26 | import org.apache.onami.autobind.annotations.Bind; 27 | import org.trinity.foundation.api.render.binding.view.delegate.PropertySlotInvocatorDelegate; 28 | 29 | import com.google.common.util.concurrent.ListenableFuture; 30 | import com.google.common.util.concurrent.ListenableFutureTask; 31 | import com.google.inject.Singleton; 32 | import com.trolltech.qt.gui.QApplication; 33 | 34 | @Bind 35 | @Singleton 36 | public class PropertySlotInvocatorDelegateImpl implements PropertySlotInvocatorDelegate { 37 | 38 | PropertySlotInvocatorDelegateImpl() { 39 | } 40 | 41 | @Override 42 | public ListenableFuture invoke( final Object view, 43 | final Method viewMethod, 44 | final Object argument) { 45 | final ListenableFutureTask invokeTask = ListenableFutureTask.create(new Callable() { 46 | @Override 47 | public Void call() throws Exception { 48 | viewMethod.invoke( view, 49 | argument); 50 | return null; 51 | } 52 | }); 53 | 54 | QApplication.invokeLater(invokeTask); 55 | return invokeTask; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /foundation/render.qt.impl/src/main/java/org/trinity/foundation/render/qt/impl/eventconverters/DestroyConversion.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.render.qt.impl.eventconverters; 21 | 22 | import org.apache.onami.autobind.annotations.Bind; 23 | import org.trinity.foundation.api.display.event.DestroyNotify; 24 | import org.trinity.foundation.render.qt.impl.RenderEventConversion; 25 | 26 | import com.google.inject.Singleton; 27 | import com.trolltech.qt.core.QEvent; 28 | import com.trolltech.qt.core.QEvent.Type; 29 | import com.trolltech.qt.core.QObject; 30 | 31 | @Deprecated 32 | @Bind(multiple = true) 33 | @Singleton 34 | public class DestroyConversion implements RenderEventConversion { 35 | 36 | DestroyConversion() { 37 | } 38 | 39 | @Override 40 | public DestroyNotify convertEvent( final Object view, 41 | final QObject eventProducer, 42 | final QEvent qEventz) { 43 | return new DestroyNotify(); 44 | } 45 | 46 | @Override 47 | public Type getQEventType() { 48 | return QEvent.Type.Close; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /foundation/render.qt.impl/src/main/java/org/trinity/foundation/render/qt/impl/eventconverters/FocusGainConversion.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.render.qt.impl.eventconverters; 21 | 22 | import org.apache.onami.autobind.annotations.Bind; 23 | import org.trinity.foundation.api.display.event.FocusGainNotify; 24 | import org.trinity.foundation.api.display.event.FocusNotify; 25 | import org.trinity.foundation.render.qt.impl.RenderEventConversion; 26 | 27 | import com.google.inject.Singleton; 28 | import com.trolltech.qt.core.QEvent; 29 | import com.trolltech.qt.core.QEvent.Type; 30 | import com.trolltech.qt.core.QObject; 31 | 32 | /** 33 | * A QFusionDestroyConverter takes a QFocusEvent and 34 | * it's DisplayEventTarget as input and converts it to a 35 | * FocusNotify. 36 | * 37 | * @author Erik De Rijcke 38 | * @since 1.0 39 | */ 40 | @Deprecated 41 | @Bind(multiple = true) 42 | @Singleton 43 | public class FocusGainConversion implements RenderEventConversion { 44 | 45 | FocusGainConversion() { 46 | } 47 | 48 | @Override 49 | public FocusNotify convertEvent(final Object view, 50 | final QObject eventProducer, 51 | final QEvent qEvent) { 52 | return new FocusGainNotify(); 53 | } 54 | 55 | @Override 56 | public Type getQEventType() { 57 | return QEvent.Type.FocusIn; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /foundation/render.qt.impl/src/main/java/org/trinity/foundation/render/qt/impl/eventconverters/FocusLostConversion.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.render.qt.impl.eventconverters; 21 | 22 | import org.apache.onami.autobind.annotations.Bind; 23 | import org.trinity.foundation.api.display.event.FocusLostNotify; 24 | import org.trinity.foundation.api.display.event.FocusNotify; 25 | import org.trinity.foundation.render.qt.impl.RenderEventConversion; 26 | 27 | import com.google.inject.Singleton; 28 | import com.trolltech.qt.core.QEvent; 29 | import com.trolltech.qt.core.QEvent.Type; 30 | import com.trolltech.qt.core.QObject; 31 | 32 | /** 33 | * A QFusionDestroyConverter takes a QFocusEvent and 34 | * it's DisplayEventTarget as input and converts it to a 35 | * FocusNotify. 36 | * 37 | * @author Erik De Rijcke 38 | * @since 1.0 39 | */ 40 | @Deprecated 41 | @Bind(multiple = true) 42 | @Singleton 43 | public class FocusLostConversion implements RenderEventConversion { 44 | 45 | FocusLostConversion() { 46 | } 47 | 48 | @Override 49 | public FocusNotify convertEvent(final Object view, 50 | final QObject eventProducer, 51 | final QEvent qEvent) { 52 | return new FocusLostNotify(); 53 | } 54 | 55 | @Override 56 | public Type getQEventType() { 57 | return QEvent.Type.FocusOut; 58 | } 59 | } -------------------------------------------------------------------------------- /foundation/render.qt.impl/src/main/java/org/trinity/foundation/render/qt/impl/eventconverters/MouseEnterConversion.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.render.qt.impl.eventconverters; 21 | 22 | import org.apache.onami.autobind.annotations.Bind; 23 | import org.trinity.foundation.api.display.event.PointerEnterNotify; 24 | import org.trinity.foundation.api.display.event.PointerVisitationNotify; 25 | import org.trinity.foundation.render.qt.impl.RenderEventConversion; 26 | 27 | import com.google.inject.Singleton; 28 | import com.trolltech.qt.core.QEvent; 29 | import com.trolltech.qt.core.QEvent.Type; 30 | import com.trolltech.qt.core.QObject; 31 | 32 | // TODO documentation 33 | /** 34 | * A QFusionMouseEnterEventConverter takes a QEvent 35 | * and it's DisplayEventTarget as input and converts it to a 36 | * MouseEnterLeaveNotifyEvent. 37 | * 38 | * @author Erik De Rijcke 39 | * @since 1.0 40 | */ 41 | @Deprecated 42 | @Bind(multiple = true) 43 | @Singleton 44 | public class MouseEnterConversion implements RenderEventConversion { 45 | 46 | MouseEnterConversion() { 47 | } 48 | 49 | @Override 50 | public PointerVisitationNotify convertEvent(final Object view, 51 | final QObject evenetProducer, 52 | final QEvent qEvent) { 53 | return new PointerEnterNotify(); 54 | } 55 | 56 | @Override 57 | public Type getQEventType() { 58 | return QEvent.Type.Enter; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /foundation/render.qt.impl/src/main/java/org/trinity/foundation/render/qt/impl/eventconverters/MouseLeaveConversion.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.render.qt.impl.eventconverters; 21 | 22 | import org.apache.onami.autobind.annotations.Bind; 23 | import org.trinity.foundation.api.display.event.PointerLeaveNotify; 24 | import org.trinity.foundation.api.display.event.PointerVisitationNotify; 25 | import org.trinity.foundation.render.qt.impl.RenderEventConversion; 26 | 27 | import com.google.inject.Singleton; 28 | import com.trolltech.qt.core.QEvent; 29 | import com.trolltech.qt.core.QEvent.Type; 30 | import com.trolltech.qt.core.QObject; 31 | 32 | // TODO documentation 33 | /** 34 | * A QFusionMouseLeaveEventConverter takes a QEvent 35 | * and it's DisplayEventTarget as input and converts it to a 36 | * MouseEnterLeaveNotifyEvent. 37 | * 38 | * @author Erik De Rijcke 39 | * @since 1.0 40 | */ 41 | @Deprecated 42 | @Bind(multiple = true) 43 | @Singleton 44 | public class MouseLeaveConversion implements RenderEventConversion { 45 | 46 | MouseLeaveConversion() { 47 | } 48 | 49 | @Override 50 | public PointerVisitationNotify convertEvent(final Object view, 51 | final QObject eventProducer, 52 | final QEvent qEventz) { 53 | return new PointerLeaveNotify(); 54 | } 55 | 56 | @Override 57 | public Type getQEventType() { 58 | return QEvent.Type.Leave; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /foundation/render.qt.impl/src/main/java/org/trinity/foundation/render/qt/impl/painter/Module.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.foundation.render.qt.impl.painter; 21 | 22 | import org.apache.onami.autobind.annotations.GuiceModule; 23 | import org.trinity.foundation.api.render.Painter; 24 | import org.trinity.foundation.api.render.PainterFactory; 25 | 26 | import com.google.inject.AbstractModule; 27 | import com.google.inject.assistedinject.FactoryModuleBuilder; 28 | import com.trolltech.qt.core.QObject; 29 | 30 | @Deprecated 31 | @GuiceModule 32 | class Module extends AbstractModule { 33 | 34 | @Override 35 | protected void configure() { 36 | install(new FactoryModuleBuilder().implement( Painter.class, 37 | PainterImpl.class).build(PainterFactory.class)); 38 | install(new FactoryModuleBuilder().implement( QObject.class, 39 | ViewEventTracker.class).build(ViewEventTrackerFactory.class)); 40 | } 41 | } -------------------------------------------------------------------------------- /foundation/render.qt.impl/src/main/java/org/trinity/foundation/render/qt/impl/painter/ViewEventTrackerFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.foundation.render.qt.impl.painter; 22 | 23 | import org.trinity.foundation.api.shared.AsyncListenable; 24 | 25 | import com.trolltech.qt.core.QObject; 26 | 27 | @Deprecated 28 | public interface ViewEventTrackerFactory { 29 | QObject createQJEventTracker( final AsyncListenable target, 30 | final QObject view); 31 | } 32 | -------------------------------------------------------------------------------- /foundation/render.qt.impl/src/test/java/org/trinity/render/qt/impl/DummyQJRenderEngine.java: -------------------------------------------------------------------------------- 1 | package org.trinity.render.qt.impl; 2 | 3 | import com.trolltech.qt.gui.QApplication; 4 | 5 | public class DummyQJRenderEngine extends QApplication { 6 | 7 | public DummyQJRenderEngine() { 8 | super(new String[] {}); 9 | } 10 | } -------------------------------------------------------------------------------- /foundation/render.qt.impl/src/test/java/org/trinity/render/qt/impl/DummyView.java: -------------------------------------------------------------------------------- 1 | package org.trinity.render.qt.impl; 2 | 3 | import com.trolltech.qt.gui.QLayout; 4 | import com.trolltech.qt.gui.QPushButton; 5 | import com.trolltech.qt.gui.QVBoxLayout; 6 | import com.trolltech.qt.gui.QWidget; 7 | 8 | public class DummyView extends QWidget { 9 | 10 | private final QPushButton pushButton0 = new QPushButton("button0", 11 | this); 12 | private final QPushButton pushButton1 = new QPushButton("button1", 13 | this); 14 | 15 | private QPushButton button; 16 | 17 | private final QLayout layout = new QVBoxLayout(this); 18 | 19 | public DummyView() { 20 | 21 | this.pushButton0.resize(100, 22 | 100); 23 | this.pushButton1.resize(50, 24 | 50); 25 | 26 | this.layout.addWidget(this.pushButton0); 27 | this.layout.addWidget(this.pushButton1); 28 | setLayout(this.layout); 29 | makebutton0Active(); 30 | show(); 31 | this.layout.layout(); 32 | } 33 | 34 | public void viewSlot0(final Object arg) { 35 | 36 | } 37 | 38 | public void viewSlot1(final Object arg) { 39 | 40 | } 41 | 42 | public QWidget button() { 43 | return this.button; 44 | } 45 | 46 | public QPushButton getPushButton0() { 47 | return this.pushButton0; 48 | } 49 | 50 | public QPushButton getPushButton1() { 51 | return this.pushButton1; 52 | } 53 | 54 | public void makebutton0Active() { 55 | this.button = this.pushButton0; 56 | } 57 | 58 | public void makebutton1Actiate() { 59 | this.button = this.pushButton1; 60 | } 61 | } -------------------------------------------------------------------------------- /shell/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.project 3 | /shell.iml 4 | /pom.xml.releaseBackup 5 | -------------------------------------------------------------------------------- /shell/api/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /target 3 | /.classpath 4 | /.project 5 | /shell.core.api.iml 6 | /bin 7 | /pom.xml.releaseBackup 8 | -------------------------------------------------------------------------------- /shell/api/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | 6 | shell 7 | org.trinity 8 | 0.0.2 9 | 10 | 11 | shell.api 12 | Shell API 13 | bundle 14 | 15 | 16 | 17 | ${project.groupId} 18 | foundation.api 19 | ${project.version} 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/bindingkey/ShellExecutor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shell.api.bindingkey; 22 | 23 | import static java.lang.annotation.ElementType.FIELD; 24 | import static java.lang.annotation.ElementType.METHOD; 25 | import static java.lang.annotation.ElementType.PARAMETER; 26 | import static java.lang.annotation.ElementType.TYPE; 27 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 28 | 29 | import java.lang.annotation.Retention; 30 | import java.lang.annotation.Target; 31 | 32 | import javax.inject.Singleton; 33 | 34 | import org.trinity.foundation.api.shared.ExecutionContext; 35 | 36 | import com.google.common.util.concurrent.ListeningExecutorService; 37 | import com.google.inject.BindingAnnotation; 38 | 39 | /** 40 | * Used for the 'Shell' {@link ExecutionContext}. A {@link Singleton} 41 | * {@link ListeningExecutorService} with this key is provided by the 42 | * org.trinity.foundation.shell.api package. 43 | */ 44 | @BindingAnnotation 45 | @Target({ TYPE, FIELD, PARAMETER, METHOD }) 46 | @Retention(RUNTIME) 47 | public @interface ShellExecutor { 48 | } 49 | -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/bindingkey/ShellRootNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shell.api.bindingkey; 22 | 23 | import static java.lang.annotation.ElementType.FIELD; 24 | import static java.lang.annotation.ElementType.METHOD; 25 | import static java.lang.annotation.ElementType.PARAMETER; 26 | import static java.lang.annotation.ElementType.TYPE; 27 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 28 | 29 | import java.lang.annotation.Retention; 30 | import java.lang.annotation.Target; 31 | 32 | import javax.inject.Singleton; 33 | 34 | import org.trinity.shell.api.scene.ShellNodeParent; 35 | 36 | import com.google.inject.BindingAnnotation; 37 | 38 | /** 39 | * Used for the root {@link ShellNodeParent} {@link Singleton}. Instance 40 | * not provided by the shell api. 41 | */ 42 | @BindingAnnotation 43 | @Target({ TYPE, FIELD, PARAMETER, METHOD }) 44 | @Retention(RUNTIME) 45 | public @interface ShellRootNode { 46 | } 47 | -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/bindingkey/ShellScene.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shell.api.bindingkey; 22 | 23 | import static java.lang.annotation.ElementType.FIELD; 24 | import static java.lang.annotation.ElementType.METHOD; 25 | import static java.lang.annotation.ElementType.PARAMETER; 26 | import static java.lang.annotation.ElementType.TYPE; 27 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 28 | 29 | import java.lang.annotation.Retention; 30 | import java.lang.annotation.Target; 31 | 32 | import org.trinity.foundation.api.shared.AsyncListenable; 33 | 34 | import com.google.inject.BindingAnnotation; 35 | 36 | import javax.inject.Singleton; 37 | 38 | /** 39 | * Used for the {@link AsyncListenable} shell scene 40 | * {@link Singleton}. Instance provided by the org.trinity.shell.api package. 41 | */ 42 | @BindingAnnotation 43 | @Target({ TYPE, FIELD, PARAMETER, METHOD }) 44 | @Retention(RUNTIME) 45 | public @interface ShellScene { 46 | } 47 | -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/bindingkey/ShellVirtualNode.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shell.api.bindingkey; 22 | 23 | import static java.lang.annotation.ElementType.FIELD; 24 | import static java.lang.annotation.ElementType.METHOD; 25 | import static java.lang.annotation.ElementType.PARAMETER; 26 | import static java.lang.annotation.ElementType.TYPE; 27 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 28 | 29 | import java.lang.annotation.Retention; 30 | import java.lang.annotation.Target; 31 | 32 | import com.google.inject.BindingAnnotation; 33 | import org.trinity.shell.api.scene.ShellNodeParent; 34 | 35 | /** 36 | * Used when a 'virtual' {@link ShellNodeParent} non-singleton instance is required. This node acts like 37 | * any other node in the scene but has no visual appearance. Implementation not provided by the api. 38 | */ 39 | @BindingAnnotation 40 | @Target({ TYPE, FIELD, PARAMETER, METHOD }) 41 | @Retention(RUNTIME) 42 | public @interface ShellVirtualNode { 43 | } 44 | -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides useful objects through the Guice dependency injection framework for 3 | * use with the shell API. See {@link org.trinity.shell.api.Module}. 4 | */ 5 | package org.trinity.shell.api; -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/plugin/ShellPlugin.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.plugin; 21 | 22 | import com.google.common.util.concurrent.ListenableFuture; 23 | import com.google.common.util.concurrent.Service; 24 | 25 | /***************************************** 26 | * General marker interface for every shell plugin. Every shell plugin has a 27 | * start() and stop() method that is called by the 28 | * shell when a plugin is started and stopped respectively. Calls to 29 | * {@code start()} and {@code stop} should be non-blocking and should not spawn 30 | * any additional threads unless absolutely necessary. Instead a shell plugin 31 | * should hook into the shell thread itself. Should a shell plugin start a new 32 | * thread then this thread should not call any object internals that live 33 | * outside it's own shell plugin implementation, instead use the 34 | * {@link ListenableFuture}s provided throughout the shell api. This keeps for a 35 | * more thread safe and more predictable behavior of shell 36 | * plugins. 37 | * 38 | * 39 | ****************************************/ 40 | public interface ShellPlugin extends Service { 41 | 42 | } 43 | -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/plugin/ShellPluginsRunner.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.plugin; 21 | 22 | /*************************************** 23 | * Starts and stops all the {@link ShellPlugin}s. 24 | *************************************** 25 | */ 26 | public interface ShellPluginsRunner { 27 | 28 | /*************************************** 29 | * Start all {@link ShellPlugin}s. 30 | *************************************** 31 | */ 32 | void startAll(); 33 | 34 | /*************************************** 35 | * Stop all {@link ShellPlugin}s. 36 | *************************************** 37 | */ 38 | void stopAll(); 39 | } 40 | -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/plugin/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides the shell with extensions through 3 | * {@link org.trinity.shell.api.plugin.ShellPlugin}s. 4 | */ 5 | package org.trinity.shell.api.plugin; -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/ShellNodeChildAddedEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.event; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | import org.trinity.shell.api.scene.ShellNode; 28 | import org.trinity.shell.api.scene.ShellNodeTransformation; 29 | 30 | /*************************************** 31 | * Informs that a child {@link ShellNode} was added to the node that emitted 32 | * this event. 33 | * 34 | *************************************** 35 | */ 36 | @Immutable 37 | @ExecutionContext(ShellExecutor.class) 38 | public class ShellNodeChildAddedEvent extends ShellNodeChildEvent { 39 | 40 | /** 41 | * Create a new {@code ShellNodeChildAddedEvent} with the given 42 | * {@code ShellNode} as the node that emitted the event, and the given 43 | * {@code ShellNodeTransformation} as the details coming from the given node 44 | * e.g. {@link ShellNode#toGeoTransformation()} 45 | * 46 | * @param shellNode 47 | * the emitting {@link ShellNode} 48 | * @param shellNodeTransformation 49 | * a {@link ShellNodeTransformation} 50 | */ 51 | public ShellNodeChildAddedEvent(@Nonnull final ShellNode shellNode, 52 | @Nonnull final ShellNodeTransformation shellNodeTransformation) { 53 | super( shellNode, 54 | shellNodeTransformation); 55 | } 56 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/ShellNodeDestroyedEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.event; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | import org.trinity.shell.api.scene.ShellNode; 28 | import org.trinity.shell.api.scene.ShellNodeTransformation; 29 | 30 | /*************************************** 31 | * Informs that the {@link ShellNode} that emitted this event was destroyed. 32 | * 33 | *************************************** 34 | */ 35 | @Immutable 36 | @ExecutionContext(ShellExecutor.class) 37 | public class ShellNodeDestroyedEvent extends ShellNodeEvent { 38 | 39 | /** 40 | * Create a new {@code ShellNodeChildAddedEvent} with the given 41 | * {@code ShellNode} as the node that emitted the event, and the given 42 | * {@code ShellNodeTransformation} as the details coming from the given node 43 | * e.g. {@link ShellNode#toGeoTransformation()} 44 | * 45 | * @param shellNode 46 | * the emitting {@link ShellNode} 47 | * @param shellNodeTransformation 48 | * a {@link ShellNodeTransformation} 49 | */ 50 | public ShellNodeDestroyedEvent(@Nonnull final ShellNode shellNode, 51 | @Nonnull final ShellNodeTransformation shellNodeTransformation) { 52 | super( shellNode, 53 | shellNodeTransformation); 54 | } 55 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/ShellNodeHiddenEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.event; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | import org.trinity.shell.api.scene.ShellNode; 28 | import org.trinity.shell.api.scene.ShellNodeTransformation; 29 | 30 | /*************************************** 31 | * Informs that the {@link ShellNode} that emitted this event is hidden. 32 | * 33 | *************************************** 34 | */ 35 | @Immutable 36 | @ExecutionContext(ShellExecutor.class) 37 | public class ShellNodeHiddenEvent extends ShellNodeVisibilityEvent { 38 | 39 | /** 40 | * Create a new {@code ShellNodeChildAddedEvent} with the given 41 | * {@code ShellNode} as the node that emitted the event, and the given 42 | * {@code ShellNodeTransformation} as the details coming from the given node 43 | * e.g. {@link ShellNode#toGeoTransformation()} 44 | * 45 | * @param shellNode 46 | * the emitting {@link ShellNode} 47 | * @param shellNodeTransformation 48 | * a {@link ShellNodeTransformation} 49 | */ 50 | public ShellNodeHiddenEvent(@Nonnull final ShellNode shellNode, 51 | @Nonnull final ShellNodeTransformation shellNodeTransformation) { 52 | super( shellNode, 53 | shellNodeTransformation); 54 | } 55 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/ShellNodeLoweredEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.event; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | import org.trinity.shell.api.scene.ShellNode; 28 | import org.trinity.shell.api.scene.ShellNodeTransformation; 29 | 30 | /*************************************** 31 | * Informs that the {@link ShellNode} that emits this event is lowered. 32 | * 33 | *************************************** 34 | */ 35 | @Immutable 36 | @ExecutionContext(ShellExecutor.class) 37 | public class ShellNodeLoweredEvent extends ShellNodeStackingEvent { 38 | 39 | /** 40 | * Create a new {@code ShellNodeChildAddedEvent} with the given 41 | * {@code ShellNode} as the node that emitted the event, and the given 42 | * {@code ShellNodeTransformation} as the details coming from the given node 43 | * e.g. {@link ShellNode#toGeoTransformation()} 44 | * 45 | * @param shellNode 46 | * the emitting {@link ShellNode} 47 | * @param shellNodeTransformation 48 | * a {@link ShellNodeTransformation} 49 | */ 50 | public ShellNodeLoweredEvent(@Nonnull final ShellNode shellNode, 51 | @Nonnull final ShellNodeTransformation shellNodeTransformation) { 52 | super( shellNode, 53 | shellNodeTransformation); 54 | } 55 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/ShellNodeMoveRequestEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.event; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | import org.trinity.shell.api.scene.ShellNode; 28 | import org.trinity.shell.api.scene.ShellNodeTransformation; 29 | 30 | /*************************************** 31 | * Request to move the {@link ShellNode} that emits this event. 32 | * 33 | *************************************** 34 | */ 35 | @Immutable 36 | @ExecutionContext(ShellExecutor.class) 37 | public class ShellNodeMoveRequestEvent extends ShellNodeEvent { 38 | 39 | /** 40 | * Create a new {@code ShellNodeChildAddedEvent} with the given 41 | * {@code ShellNode} as the node that emitted the event, and the given 42 | * {@code ShellNodeTransformation} as the details coming from the given node 43 | * e.g. {@link ShellNode#toGeoTransformation()} 44 | * 45 | * @param shellNode 46 | * the emitting {@link ShellNode} 47 | * @param shellNodeTransformation 48 | * a {@link ShellNodeTransformation} 49 | */ 50 | public ShellNodeMoveRequestEvent(@Nonnull final ShellNode shellNode, 51 | @Nonnull final ShellNodeTransformation shellNodeTransformation) { 52 | super( shellNode, 53 | shellNodeTransformation); 54 | } 55 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/ShellNodeMovedEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.event; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | import org.trinity.shell.api.scene.ShellNode; 28 | import org.trinity.shell.api.scene.ShellNodeTransformation; 29 | 30 | /*************************************** 31 | * Informs that the {@link ShellNode} that emits this event, is moved. 32 | * 33 | *************************************** 34 | */ 35 | @Immutable 36 | @ExecutionContext(ShellExecutor.class) 37 | public class ShellNodeMovedEvent extends ShellNodeEvent { 38 | 39 | /** 40 | * Create a new {@code ShellNodeChildAddedEvent} with the given 41 | * {@code ShellNode} as the node that emitted the event, and the given 42 | * {@code ShellNodeTransformation} as the details coming from the given node 43 | * e.g. {@link ShellNode#toGeoTransformation()} 44 | * 45 | * @param shellNode 46 | * the emitting {@link ShellNode} 47 | * @param shellNodeTransformation 48 | * a {@link ShellNodeTransformation} 49 | */ 50 | public ShellNodeMovedEvent(@Nonnull final ShellNode shellNode, 51 | @Nonnull final ShellNodeTransformation shellNodeTransformation) { 52 | super( shellNode, 53 | shellNodeTransformation); 54 | } 55 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/ShellNodeRaisedEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.event; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | import org.trinity.shell.api.scene.ShellNode; 28 | import org.trinity.shell.api.scene.ShellNodeTransformation; 29 | 30 | /************************************** 31 | * Informs that the {@link ShellNode} that emitted this event, is raised. 32 | * 33 | *************************************** 34 | */ 35 | @Immutable 36 | @ExecutionContext(ShellExecutor.class) 37 | public class ShellNodeRaisedEvent extends ShellNodeStackingEvent { 38 | 39 | /** 40 | * Create a new {@code ShellNodeChildAddedEvent} with the given 41 | * {@code ShellNode} as the node that emitted the event, and the given 42 | * {@code ShellNodeTransformation} as the details coming from the given node 43 | * e.g. {@link ShellNode#toGeoTransformation()} 44 | * 45 | * @param shellNode 46 | * the emitting {@link ShellNode} 47 | * @param shellNodeTransformation 48 | * a {@link ShellNodeTransformation} 49 | */ 50 | public ShellNodeRaisedEvent(@Nonnull final ShellNode shellNode, 51 | @Nonnull final ShellNodeTransformation shellNodeTransformation) { 52 | super( shellNode, 53 | shellNodeTransformation); 54 | } 55 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/ShellNodeReparentedEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.event; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | import org.trinity.shell.api.scene.ShellNode; 28 | import org.trinity.shell.api.scene.ShellNodeTransformation; 29 | 30 | /*************************************** 31 | * Informs that the {@link ShellNode} that emitted this event, is reparented. 32 | * 33 | *************************************** 34 | */ 35 | @Immutable 36 | @ExecutionContext(ShellExecutor.class) 37 | public class ShellNodeReparentedEvent extends ShellNodeEvent { 38 | 39 | /** 40 | * Create a new {@code ShellNodeChildAddedEvent} with the given 41 | * {@code ShellNode} as the node that emitted the event, and the given 42 | * {@code ShellNodeTransformation} as the details coming from the given node 43 | * e.g. {@link ShellNode#toGeoTransformation()} 44 | * 45 | * @param shellNode 46 | * the emitting {@link ShellNode} 47 | * @param shellNodeTransformation 48 | * a {@link ShellNodeTransformation} 49 | */ 50 | public ShellNodeReparentedEvent(@Nonnull final ShellNode shellNode, 51 | @Nonnull final ShellNodeTransformation shellNodeTransformation) { 52 | super( shellNode, 53 | shellNodeTransformation); 54 | } 55 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/ShellNodeResizeRequestEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.event; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | import org.trinity.shell.api.scene.ShellNode; 28 | import org.trinity.shell.api.scene.ShellNodeTransformation; 29 | 30 | /*************************************** 31 | * Request to resize the {@link ShellNode} that emits this event. 32 | * 33 | *************************************** 34 | */ 35 | @Immutable 36 | @ExecutionContext(ShellExecutor.class) 37 | public class ShellNodeResizeRequestEvent extends ShellNodeEvent { 38 | 39 | /** 40 | * Create a new {@code ShellNodeChildAddedEvent} with the given 41 | * {@code ShellNode} as the node that emitted the event, and the given 42 | * {@code ShellNodeTransformation} as the details coming from the given node 43 | * e.g. {@link ShellNode#toGeoTransformation()} 44 | * 45 | * @param shellNode 46 | * the emitting {@link ShellNode} 47 | * @param shellNodeTransformation 48 | * a {@link ShellNodeTransformation} 49 | */ 50 | public ShellNodeResizeRequestEvent( @Nonnull final ShellNode shellNode, 51 | @Nonnull final ShellNodeTransformation shellNodeTransformation) { 52 | super( shellNode, 53 | shellNodeTransformation); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/ShellNodeResizedEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.event; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | import org.trinity.shell.api.scene.ShellNode; 28 | import org.trinity.shell.api.scene.ShellNodeTransformation; 29 | 30 | /*************************************** 31 | * Informs that the {@link ShellNode} that emitted this event, is resized. 32 | * 33 | *************************************** 34 | */ 35 | @Immutable 36 | @ExecutionContext(ShellExecutor.class) 37 | public class ShellNodeResizedEvent extends ShellNodeEvent { 38 | 39 | /** 40 | * Create a new {@code ShellNodeChildAddedEvent} with the given 41 | * {@code ShellNode} as the node that emitted the event, and the given 42 | * {@code ShellNodeTransformation} as the details coming from the given node 43 | * e.g. {@link ShellNode#toGeoTransformation()} 44 | * 45 | * @param shellNode 46 | * the emitting {@link ShellNode} 47 | * @param shellNodeTransformation 48 | * a {@link ShellNodeTransformation} 49 | */ 50 | public ShellNodeResizedEvent(@Nonnull final ShellNode shellNode, 51 | @Nonnull final ShellNodeTransformation shellNodeTransformation) { 52 | super( shellNode, 53 | shellNodeTransformation); 54 | } 55 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/ShellNodeShowedEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.event; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | import org.trinity.shell.api.scene.ShellNode; 28 | import org.trinity.shell.api.scene.ShellNodeTransformation; 29 | 30 | /*************************************** 31 | * Informs that the {@link ShellNode} that emitted this event, is showed. 32 | * 33 | *************************************** 34 | */ 35 | @Immutable 36 | @ExecutionContext(ShellExecutor.class) 37 | public class ShellNodeShowedEvent extends ShellNodeVisibilityEvent { 38 | 39 | /** 40 | * Create a new {@code ShellNodeChildAddedEvent} with the given 41 | * {@code ShellNode} as the node that emitted the event, and the given 42 | * {@code ShellNodeTransformation} as the details coming from the given node 43 | * e.g. {@link ShellNode#toGeoTransformation()} 44 | * 45 | * @param shellNode 46 | * the emitting {@link ShellNode} 47 | * @param shellNodeTransformation 48 | * a {@link ShellNodeTransformation} 49 | */ 50 | public ShellNodeShowedEvent(@Nonnull final ShellNode shellNode, 51 | @Nonnull final ShellNodeTransformation shellNodeTransformation) { 52 | super( shellNode, 53 | shellNodeTransformation); 54 | } 55 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/ShellNodeStackingEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.event; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | import org.trinity.shell.api.scene.ShellNode; 28 | import org.trinity.shell.api.scene.ShellNodeTransformation; 29 | 30 | /*************************************** 31 | * General event to inform about stacking (raise, lower) related operations. 32 | * 33 | *************************************** 34 | */ 35 | @Immutable 36 | @ExecutionContext(ShellExecutor.class) 37 | public class ShellNodeStackingEvent extends ShellNodeEvent { 38 | 39 | /** 40 | * Create a new {@code ShellNodeChildAddedEvent} with the given 41 | * {@code ShellNode} as the node that emitted the event, and the given 42 | * {@code ShellNodeTransformation} as the details coming from the given node 43 | * e.g. {@link ShellNode#toGeoTransformation()} 44 | * 45 | * @param shellNode 46 | * the emitting {@link ShellNode} 47 | * @param shellNodeTransformation 48 | * a {@link ShellNodeTransformation} 49 | */ 50 | public ShellNodeStackingEvent(@Nonnull final ShellNode shellNode, 51 | @Nonnull final ShellNodeTransformation shellNodeTransformation) { 52 | super( shellNode, 53 | shellNodeTransformation); 54 | } 55 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/ShellNodeVisibilityEvent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.event; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.ExecutionContext; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | import org.trinity.shell.api.scene.ShellNode; 28 | import org.trinity.shell.api.scene.ShellNodeTransformation; 29 | 30 | /*************************************** 31 | * General event to inform about visibility (show, hide) related operations. 32 | *************************************** 33 | */ 34 | @Immutable 35 | @ExecutionContext(ShellExecutor.class) 36 | public class ShellNodeVisibilityEvent extends ShellNodeEvent { 37 | 38 | /** 39 | * Create a new {@code ShellNodeChildAddedEvent} with the given 40 | * {@code ShellNode} as the node that emitted the event, and the given 41 | * {@code ShellNodeTransformation} as the details coming from the given node 42 | * e.g. {@link ShellNode#toGeoTransformation()} 43 | * 44 | * @param shellNode 45 | * the emitting {@link ShellNode} 46 | * @param shellNodeTransformation 47 | * a {@link ShellNodeTransformation} 48 | */ 49 | public ShellNodeVisibilityEvent(@Nonnull final ShellNode shellNode, 50 | @Nonnull final ShellNodeTransformation shellNodeTransformation) { 51 | super( shellNode, 52 | shellNodeTransformation); 53 | } 54 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/event/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Events emitted by a {@link org.trinity.shell.api.scene.ShellNode}. 3 | */ 4 | package org.trinity.shell.api.scene.event; -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/manager/ShellLayoutProperty.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.scene.manager; 21 | 22 | /*************************************** 23 | * Marker interface for child layout properties. 24 | * 25 | *************************************** 26 | */ 27 | public interface ShellLayoutProperty { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/manager/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Layout managers that can be used by a 3 | * {@link org.trinity.shell.api.scene.ShellNodeParent} to layout it's children. 4 | */ 5 | package org.trinity.shell.api.scene.manager; -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/scene/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * A basic high level shell scene. 3 | */ 4 | package org.trinity.shell.api.scene; -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/surface/AbstractShellSurfaceParent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.surface; 21 | 22 | import javax.annotation.Nonnull; 23 | import javax.annotation.concurrent.NotThreadSafe; 24 | 25 | import org.trinity.foundation.api.shared.AsyncListenable; 26 | import org.trinity.foundation.api.shared.ExecutionContext; 27 | import org.trinity.shell.api.bindingkey.ShellExecutor; 28 | import org.trinity.shell.api.bindingkey.ShellScene; 29 | import org.trinity.shell.api.scene.ShellNode; 30 | import org.trinity.shell.api.scene.ShellNodeParent; 31 | 32 | import com.google.common.util.concurrent.ListeningExecutorService; 33 | 34 | /*************************************** 35 | * An {@link AbstractShellSurface} that can have child {@link ShellNode}s. 36 | * 37 | *************************************** 38 | */ 39 | @ExecutionContext(ShellExecutor.class) 40 | @NotThreadSafe 41 | public abstract class AbstractShellSurfaceParent extends AbstractShellSurface implements ShellSurfaceParent { 42 | 43 | protected AbstractShellSurfaceParent( @Nonnull final ShellNodeParent shellRootNode, 44 | @Nonnull @ShellScene final AsyncListenable shellScene, 45 | @Nonnull@ShellExecutor final ListeningExecutorService shellExecutor) { 46 | super( shellRootNode, 47 | shellScene, 48 | shellExecutor); 49 | } 50 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/surface/ShellSurfaceFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.surface; 21 | 22 | import org.trinity.foundation.api.display.DisplaySurface; 23 | import org.trinity.foundation.api.shared.ExecutionContext; 24 | 25 | import com.google.common.util.concurrent.ListenableFuture; 26 | import org.trinity.shell.api.bindingkey.ShellExecutor; 27 | 28 | import javax.annotation.Nonnull; 29 | 30 | /*************************************** 31 | * Creates shell surfaces from a display surface. 32 | *************************************** 33 | */ 34 | @ExecutionContext(ShellExecutor.class) 35 | public interface ShellSurfaceFactory { 36 | /*************************************** 37 | * Create a new shell surface that is backed by the given display surface. 38 | * The new shell surface will have the root shell surface as its parent. 39 | * 40 | * @param displaySurface 41 | * a {@link DisplaySurface} 42 | * @return a new future {@link ShellSurface}. 43 | *************************************** 44 | */ 45 | ListenableFuture createShellClientSurface(@Nonnull DisplaySurface displaySurface); 46 | } -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/surface/ShellSurfaceParent.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.surface; 21 | 22 | import org.trinity.shell.api.scene.ShellNode; 23 | import org.trinity.shell.api.scene.ShellNodeParent; 24 | 25 | /*************************************** 26 | * A {@link ShellSurface} that can have child {@link ShellNode}s. 27 | *************************************** 28 | */ 29 | public interface ShellSurfaceParent extends ShellSurface, ShellNodeParent { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/surface/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Links the shell scene to the foundation display API. 3 | */ 4 | package org.trinity.shell.api.surface; -------------------------------------------------------------------------------- /shell/api/src/main/java/org/trinity/shell/api/widget/ShellWidget.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | package org.trinity.shell.api.widget; 21 | 22 | import org.trinity.foundation.api.render.Painter; 23 | import org.trinity.foundation.api.shared.ExecutionContext; 24 | import org.trinity.shell.api.bindingkey.ShellExecutor; 25 | import org.trinity.shell.api.surface.ShellSurfaceParent; 26 | 27 | /*************************************** 28 | * Provides visual elements for the user to interact with in the shell scene. 29 | *************************************** 30 | */ 31 | @Deprecated 32 | @ExecutionContext(ShellExecutor.class) 33 | public interface ShellWidget extends ShellSurfaceParent { 34 | 35 | /*************************************** 36 | * The object to interface with the render back-end. A {@code Painter} 37 | * instance is dedicated to a single {@code ShellWidget} instance and should 38 | * not change. 39 | * 40 | * @return a {@link Painter}. 41 | *************************************** 42 | */ 43 | Painter getPainter(); 44 | } 45 | -------------------------------------------------------------------------------- /shell/plugin.impl/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | /target 5 | /shell.core.impl.plugin.iml 6 | /bin 7 | /pom.xml.releaseBackup 8 | -------------------------------------------------------------------------------- /shell/plugin.impl/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | shell 4 | org.trinity 5 | 0.0.2 6 | 7 | 8 | 4.0.0 9 | 10 | shell.plugin.impl 11 | Shell Plugin Implementation 12 | bundle 13 | 14 | 15 | 16 | ${project.groupId} 17 | shell.api 18 | ${project.version} 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /shell/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | trinity 5 | org.trinity 6 | 0.0.2 7 | 8 | 9 | 4.0.0 10 | 11 | shell 12 | Shell 13 | pom 14 | 15 | 16 | api 17 | scene.impl 18 | plugin.impl 19 | surface.impl 20 | 21 | 22 | -------------------------------------------------------------------------------- /shell/scene.impl/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | /target 5 | /shell.core.impl.node.iml 6 | /bin 7 | /pom.xml.releaseBackup 8 | -------------------------------------------------------------------------------- /shell/scene.impl/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | shell 4 | org.trinity 5 | 0.0.2 6 | 7 | 8 | 4.0.0 9 | 10 | shell.scene.impl 11 | Shell Scene implementation 12 | bundle 13 | 14 | 15 | 16 | ${project.groupId} 17 | shell.api 18 | ${project.version} 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /shell/scene.impl/src/test/java/org/trinity/shell/impl/node/ShellGeoVNodeTest.java: -------------------------------------------------------------------------------- 1 | package org.trinity.shell.impl.node; 2 | 3 | import org.junit.Test; 4 | 5 | public class ShellGeoVNodeTest { 6 | 7 | @Test 8 | public void testRequestDelegatings() { 9 | 10 | } 11 | 12 | @Test 13 | public void testReparenting() { 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /shell/scene.impl/src/test/java/org/trinity/shell/impl/node/manager/ShellLayoutManagerLineTest.java: -------------------------------------------------------------------------------- 1 | package org.trinity.shell.impl.node.manager; 2 | 3 | import org.junit.Test; 4 | 5 | public class ShellLayoutManagerLineTest { 6 | 7 | @Test 8 | public void testLayoutH() { 9 | 10 | } 11 | 12 | @Test 13 | public void testLayoutHinvert() { 14 | 15 | } 16 | 17 | @Test 18 | public void testLayoutV() { 19 | 20 | } 21 | 22 | @Test 23 | public void testLayoutVInvert() { 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /shell/surface.impl/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | /target 5 | /shell.core.impl.surface.iml 6 | /bin 7 | /pom.xml.releaseBackup 8 | -------------------------------------------------------------------------------- /shell/surface.impl/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | shell 4 | org.trinity 5 | 0.0.2 6 | 7 | 8 | 4.0.0 9 | 10 | shell.surface.impl 11 | Shell Surface Implementation 12 | bundle 13 | 14 | 15 | 16 | ${project.groupId} 17 | shell.api 18 | ${project.version} 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /shellplugin/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.project 3 | /shellplugin.iml 4 | /pom.xml.releaseBackup 5 | -------------------------------------------------------------------------------- /shellplugin/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | trinity 5 | org.trinity 6 | 0.0.2 7 | 8 | 4.0.0 9 | shellplugin 10 | Shell Plugin 11 | pom 12 | 13 | 14 | widget.view.qt.api 15 | wm.api 16 | wm.x11.impl 17 | 18 | 19 | 20 | 21 | ${project.groupId} 22 | shell.api 23 | ${project.version} 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /shellplugin/widget.view.qt.api/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /target 3 | /.classpath 4 | /.project 5 | /bin 6 | /pom.xml.releaseBackup 7 | -------------------------------------------------------------------------------- /shellplugin/widget.view.qt.api/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | 6 | 7 | org.trinity 8 | shellplugin 9 | 0.0.2 10 | 11 | 12 | shellplugin.widget.view.qt.api 13 | Shellplugin Widget View QtJambi API 14 | bundle 15 | 16 | 17 | 18 | qtjambi 19 | qtjambi 20 | http://qtjambi.sourceforge.net/maven2/ 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | net.sf.qtjambi 29 | qtjambi 30 | 31 | 4.6.3.2 32 | 33 | 34 | -------------------------------------------------------------------------------- /shellplugin/wm.api/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /target 3 | /.classpath 4 | /.project 5 | -------------------------------------------------------------------------------- /shellplugin/wm.api/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | 6 | 7 | org.trinity 8 | shellplugin 9 | 0.0.2 10 | 11 | 12 | shellplugin.wm.api 13 | Shell Window Manager API 14 | bundle 15 | 16 | -------------------------------------------------------------------------------- /shellplugin/wm.api/src/main/java/org/trinity/shellplugin/wm/api/Desktop.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shellplugin.wm.api; 22 | 23 | import java.util.List; 24 | 25 | import org.trinity.shell.api.widget.ShellWidget; 26 | 27 | public interface Desktop extends ShellWidget { 28 | 29 | List getNotificationsBar(); 30 | 31 | List getClientsBar(); 32 | 33 | List getBottomBar(); 34 | } 35 | -------------------------------------------------------------------------------- /shellplugin/wm.api/src/main/java/org/trinity/shellplugin/wm/api/HasImageDefinition.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shellplugin.wm.api; 22 | 23 | public interface HasImageDefinition { 24 | ImageDefinition getImageDefinition(); 25 | } 26 | -------------------------------------------------------------------------------- /shellplugin/wm.api/src/main/java/org/trinity/shellplugin/wm/api/HasText.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shellplugin.wm.api; 22 | 23 | public interface HasText { 24 | String getText(); 25 | } 26 | -------------------------------------------------------------------------------- /shellplugin/wm.api/src/main/java/org/trinity/shellplugin/wm/api/ImageDefinition.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shellplugin.wm.api; 22 | 23 | import javax.annotation.concurrent.Immutable; 24 | 25 | import org.trinity.foundation.api.shared.Size; 26 | 27 | @Immutable 28 | public class ImageDefinition { 29 | 30 | private final byte[] imageData; 31 | private final Size imageSize; 32 | private final String colorModel; 33 | 34 | public ImageDefinition( final byte[] imageData, 35 | final Size imageSize, 36 | final String colorModel) { 37 | this.imageData = imageData; 38 | this.imageSize = imageSize; 39 | this.colorModel = colorModel; 40 | } 41 | 42 | public byte[] getImageData() { 43 | // immutable! 44 | final byte[] imageDataCopy = new byte[this.imageData.length]; 45 | System.arraycopy( this.imageData, 46 | 0, 47 | imageDataCopy, 48 | 0, 49 | this.imageData.length); 50 | return imageDataCopy; 51 | } 52 | 53 | public Size getImageSize() { 54 | return this.imageSize; 55 | } 56 | 57 | public String getColorModel() { 58 | return this.colorModel; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /shellplugin/wm.api/src/main/java/org/trinity/shellplugin/wm/api/ReceivesPointerInput.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shellplugin.wm.api; 22 | 23 | public interface ReceivesPointerInput { 24 | void onPointerInput(); 25 | } 26 | -------------------------------------------------------------------------------- /shellplugin/wm.x11.impl/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | /target 5 | /shellplugin.wm.impl.iml 6 | /bin 7 | /pom.xml.releaseBackup 8 | -------------------------------------------------------------------------------- /shellplugin/wm.x11.impl/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | 6 | 7 | org.trinity 8 | shellplugin 9 | 0.0.2 10 | 11 | 12 | shellplugin.wm.x11.impl 13 | Shell Window Manager X11 implementation 14 | bundle 15 | 16 | 17 | 18 | 1.8.0 19 | 20 | 21 | 22 | 23 | org.trinity 24 | foundation.display.x11.api 25 | ${project.version} 26 | 27 | 28 | org.trinity 29 | shellplugin.wm.api 30 | ${project.version} 31 | 32 | 33 | org.trinity 34 | shellplugin.widget.view.qt.api 35 | ${project.version} 36 | 37 | 38 | net.java.dev.glazedlists 39 | glazedlists_java15 40 | ${glazedlists.version} 41 | 42 | 43 | org.trinity 44 | XCB4J 45 | 0.0.1 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /shellplugin/wm.x11.impl/src/main/java/org/trinity/shellplugin/wm/x11/impl/Module.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shellplugin.wm.x11.impl; 22 | 23 | import org.apache.onami.autobind.annotations.GuiceModule; 24 | import org.trinity.shell.api.bindingkey.ShellRootNode; 25 | import org.trinity.shell.api.scene.ShellNodeParent; 26 | import org.trinity.shellplugin.wm.api.Desktop; 27 | import org.trinity.shellplugin.wm.x11.impl.scene.ClientBarElement; 28 | import org.trinity.shellplugin.wm.x11.impl.scene.ClientBarElementFactory; 29 | import org.trinity.shellplugin.wm.x11.impl.scene.ShellRootWidget; 30 | 31 | import com.google.inject.AbstractModule; 32 | import com.google.inject.assistedinject.FactoryModuleBuilder; 33 | 34 | @GuiceModule 35 | class Module extends AbstractModule { 36 | 37 | @Override 38 | protected void configure() { 39 | install(new FactoryModuleBuilder().implement( ClientBarElement.class, 40 | ClientBarElement.class).build(ClientBarElementFactory.class)); 41 | bind(ShellRootWidget.class).asEagerSingleton(); 42 | bind(ShellNodeParent.class).annotatedWith(ShellRootNode.class).to(ShellRootWidget.class); 43 | bind(Desktop.class).to(ShellRootWidget.class); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /shellplugin/wm.x11.impl/src/main/java/org/trinity/shellplugin/wm/x11/impl/protocol/icccm/ProtocolListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shellplugin.wm.x11.impl.protocol.icccm; 22 | 23 | import com.google.common.base.Optional; 24 | import com.google.common.eventbus.Subscribe; 25 | 26 | public interface ProtocolListener

{ 27 | 28 | @Subscribe 29 | void onProtocolChanged(Optional

protocol); 30 | } 31 | -------------------------------------------------------------------------------- /shellplugin/wm.x11.impl/src/main/java/org/trinity/shellplugin/wm/x11/impl/scene/ClientBarElementFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shellplugin.wm.x11.impl.scene; 22 | 23 | import org.trinity.foundation.api.display.DisplaySurface; 24 | 25 | public interface ClientBarElementFactory { 26 | 27 | ClientBarElement createClientTopBarItem(final DisplaySurface clientXWindow); 28 | } 29 | -------------------------------------------------------------------------------- /shellplugin/wm.x11.impl/src/main/java/org/trinity/shellplugin/wm/x11/impl/view/Module.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shellplugin.wm.x11.impl.view; 22 | 23 | import org.apache.onami.autobind.annotations.GuiceModule; 24 | 25 | import com.google.inject.AbstractModule; 26 | import com.google.inject.name.Names; 27 | 28 | @GuiceModule 29 | class Module extends AbstractModule { 30 | 31 | @Override 32 | protected void configure() { 33 | bind(Object.class).annotatedWith(Names.named("RootView")).toProvider(RootViewProvider.class); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shellplugin/wm.x11.impl/src/main/java/org/trinity/shellplugin/wm/x11/impl/view/NotificationsBarElementView.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shellplugin.wm.x11.impl.view; 22 | 23 | import org.trinity.foundation.api.render.binding.view.PropertySlot; 24 | import org.trinity.foundation.api.render.binding.view.PropertySlots; 25 | 26 | import com.trolltech.qt.gui.QLabel; 27 | 28 | @PropertySlots({ // 29 | @PropertySlot(propertyName = "text", methodName = "setText", argumentTypes = { String.class }) // HasText 30 | }) 31 | class NotificationsBarElementView extends QLabel { 32 | { 33 | // workaround for jambi css bug 34 | setObjectName("NotificationsBarElement"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /shellplugin/wm.x11.impl/src/main/java/org/trinity/shellplugin/wm/x11/impl/view/RootViewProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Trinity Shell Copyright (C) 2011 Erik De Rijcke 3 | * 4 | * This file is part of Trinity Shell. 5 | * 6 | * Trinity Shell is free software; you can redistribute it and/or modify it 7 | * under the terms of the GNU General Public License as published by the Free 8 | * Software Foundation; either version 3 of the License, or (at your option) any 9 | * later version. 10 | * 11 | * Trinity Shell is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 | * details. 15 | * 16 | * You should have received a copy of the GNU General Public License along with 17 | * this program; if not, write to the Free Software Foundation, Inc., 51 18 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | ******************************************************************************/ 20 | 21 | package org.trinity.shellplugin.wm.x11.impl.view; 22 | 23 | import org.trinity.shellplugin.widget.impl.view.qt.AbstractQWidgetViewProvider; 24 | 25 | public class RootViewProvider extends AbstractQWidgetViewProvider { 26 | 27 | @Override 28 | protected RootView createView() { 29 | return new RootView(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /shellplugin/wm.x11.impl/src/main/resources/views.qss: -------------------------------------------------------------------------------- 1 | #RootView { 2 | 3 | } 4 | 5 | #ClientsBar { 6 | } 7 | 8 | #NotificationsBar { 9 | 10 | } 11 | 12 | #NotificationsBarElement { 13 | 14 | } 15 | 16 | #TopBar { 17 | /*because of a bug we have to specifiy border-top for our bottom border to be visible.*/ 18 | border-top: none; 19 | border-bottom: 5px solid #22B5BF; 20 | } 21 | 22 | #BottomBar { 23 | border-top: 5px solid #88C134; 24 | } 25 | 26 | #ClientBarElement { 27 | border: 1px solid black; 28 | } 29 | 30 | #ClientCloseButton { 31 | border: 1px solid red; 32 | } 33 | 34 | #ClientName { 35 | 36 | } 37 | 38 | #ClientIcon { 39 | 40 | } -------------------------------------------------------------------------------- /site-resources/HypercubeLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zubnix/trinityshell/16672f082536e3825f6f8c9271099eb798c97fa9/site-resources/HypercubeLogo.png --------------------------------------------------------------------------------