GithubHelp home page GithubHelp logo

jsycamore's Introduction

jsycamore

Maven Central Maven Central (snapshot) Codecov

jsycamore

JVM Platform Status
OpenJDK (Temurin) Current Linux Build (OpenJDK (Temurin) Current, Linux)
OpenJDK (Temurin) LTS Linux Build (OpenJDK (Temurin) LTS, Linux)
OpenJDK (Temurin) Current Windows Build (OpenJDK (Temurin) Current, Windows)
OpenJDK (Temurin) LTS Windows Build (OpenJDK (Temurin) LTS, Windows)

jsycamore's People

Contributors

io7m avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jsycamore's Issues

Clarify event model

Some events will be delivered to components (key input events, mouse input events). Some events are generated internally by the system and will be published to the screen's events() publisher, but won't ever be delivered directly to components.

A PLACEMENT_TOP_ABOVE_FRAME embossed titlebar of height 1 is an error

It triggers an assertion failure:

Exception in thread "AWT-EventQueue-0" org.valid4j.errors.RequireViolation: Rendered rectangle height must be positive
    at org.valid4j.impl.RequireViolationPolicy.handleViolation(RequireViolationPolicy.java:19)
    at org.valid4j.impl.CheckingPolicy.check(CheckingPolicy.java:25)
    at org.valid4j.Assertive.require(Assertive.java:150)
    at com.io7m.jsycamore.core.renderer.SyEmbossed.rectangle(SyEmbossed.java:83)

Tabbed panels

A set of panels that are switched between by clicking a tab header.

Convert match methods to sealed interfaces

The component interface contains a method line this:

  /**
   * Match on the type of component.
   *
   * @param context   A context value passed through to the given functions
   * @param on_button A function evaluated if this component is a button
   * @param on_panel  A function evaluated if this component is a panel
   * @param on_label  A function evaluated if this component is a label
   * @param on_image  A function evaluated if this component is an image
   * @param on_meter  A function evaluated if this component is a meter
   * @param <A>       The type of opaque context values
   * @param <B>       The type of returned values
   *
   * @return The value returned by whichever one of the given functions is evaluated
   */

  <A, B> B matchComponent(
    A context,
    BiFunction<A, SyButtonType, B> on_button,
    BiFunction<A, SyPanelType, B> on_panel,
    BiFunction<A, SyLabelType, B> on_label,
    BiFunction<A, SyImageType, B> on_image,
    BiFunction<A, SyMeterType, B> on_meter);

This is obviously a generic visitor, and now the component type should be a sealed interface instead.

Window closing

Should there be a difference between closing a window and destroying it? Can there actually be a difference?

Combo boxes

Similar to swing combo boxes:

combo

... except that they don't need to be editable.

Needs menus (#23).

Window resizing

Each theme must decide the boxes of exactly eight components (n, ne, e, se, s, sw, w, nw).

Dragging n resizes the window upwards.
Dragging ne resizes the window upwards and rightwards.
Dragging e resizes the window rightwards.
Dragging se resizes the window downwards and rightwards.
Dragging s resizes the window downwards.
Dragging sw resizes the window downwards and leftwards.
Dragging w resizes the window leftwards.
Dragging nw resizes the window upwards and leftwards.

If a theme does not use any of the given components, it can assign a zero width, zero height box.

Split component layout function

The current layout() function declared on the SyComponentType does the necessary grunt work to lay out the current component, but it then goes on to call layout() on the child components. While it should do this, some components that override this method are only interested in the first half of the work that the method does. Unfortunately, they only have the option to call the entire method and possibly end up laying out child components twice.

Three methods should be provided: layoutThis, layoutChildren and layout. layout calls layoutThis and then layoutChildren. Overrides of layout can call layoutThis and layoutChildren as necessary.

OSGi Provide-Capability fields are wrong

They're currently declared as (for example):

<Provide-Capability>
  com.io7m.jsycamore.theme.name;type:String=Stride
</Provide-Capability>

But should be:

<Provide-Capability>
  com.io7m.jsycamore.theme;name:String=Stride
</Provide-Capability>

This is an unfortunate typo that was copied to each of the provided themes...

Vulkan compositor

Take the image of each window and render it as an OpenGL quad to the screen.

Component queries are not really correct

In SyWindowViewportAccumulator, the accumulate method assumes that negative offsets are invalid, and it clamps them. Scroll panes use negative offsets inside viewports. This test fails immediately:

  @Test
  public void testNegativeOffset()
  {
    final var accum =
      SyWindowViewportAccumulator.create();

    accum.reset(300, 300);
    accum.accumulate(PAreasI.create(-100, -100, 200, 200));

    assertEquals(-100, accum.minimumX());
    assertEquals(-100, accum.minimumY());
    assertEquals(100, accum.maximumX());
    assertEquals(100, accum.maximumY());
  }

Users can damage content panes, titlebars, etc

A window's content pane exposes a writable JOTreeNodeType<SyComponentType>. Let's assume that this is necessary because otherwise the user wouldn't be able to add any components to the content pane. The user can now detach the content pane from the window. The user can traverse up the tree and detach the titlebar from the window, etc.

Let's assume that the content pane wasn't directly exposed as a writable JOTreeNodeType but instead allowed the user to add components via an API that hides the tree itself. The individual component types do still expose their own nodes as JOTreeNodeType values, so by getting write access to a single component anywhere, the user can detach or otherwise mess with any other component in the tree.

Checkboxes

Buttons that stay pressed when pressed, and then become un-pressed when pressed again.

Document the difference between the component event and listener interfaces

The event interfaces are the interfaces used to deliver messages to components. Component implementations of these interfaces are required to pass the messages to child components and so on.

The listener interfaces are the interfaces used by components to react to messages delivered by the event interfaces. They are not responsible for doing anything other than reacting and indicating whether or not they consumed the event in question.

Switch to jboxes

The boxes package has been spun out into a separate jboxes package as code elsewhere requires it. It should be imported as a dependency and used in place of the current original types.

Menus

The GUI needs support for popup menus.

Strictly speaking, only one popup menu is ever shown at any given time, and technically exists independently of any given window (although it may be associated in some unspecified manner with the component that caused it to open in the first place).

Strengthen semantics of child node order

With PLACEMENT_TOP_OVERLAP_FRAME, any region of the frame underneath the titlebar will receive mouse events instead of the titlebar. This is in keeping with the component model, but is unfortunate!

Radio buttons

A group of buttons similar to #18 but with the restriction that only one button in the group may be pressed at any given time.

Window scaling is erratic when snapping

With window positions and sizes snapped to a value of some larger value such as 16, dragging the west resize handles will often result in the right edge of the window snapping to various values and not really resizing correctly.

Keyboard and focus handling

Currently, keyboard events go nowhere. The screen tracks focused components but doesn't deliver keyboard events.

Sliders

Horizontal and vertical sliders.

Embossed outlining

To correctly simulate Haiku, it's necessary to emboss the outlines of UI elements. This is also used by the old Mac OS Platinum UI.

emboss

Note how the progress bar in the Haiku image has an embossed outline, and the close button in the Platinum example has an outermost emboss, a black outline inside that, and further embossing inside that!

Window maximizing

To implement this, the viewport needs an explicit size and windows need to store an unmaximized box.

Text areas

Large, multi-line areas for text.

  • Text selection (LTR, RTL)
  • Text scrolling
  • Text character removal
  • Text character insertion

Make window layers into big integers

To give people more organizational freedom, the fixed int-based window layers should be moved to BigInteger values, and the layer used for menus should become configurable.

Gradient fills

Needed to simulate the subtle gradient fills of Haiku:

17-copying

Move line numbers out of measured lines

Bounds in a measured line should be returned in text-local space (not parent-relative space).

Line numbers should be moved out of the measured line data structure.

With these two changes, text models can avoid recalculating measured lines just because some earlier text section was changed and now all of the line numbers are incorrect. Line numbers should be a property of the structures storing the measured lines, not the measured lines themselves.

Move to the checker framework annotations instead of jnull

This will probably apply to all io7m packages, but jsycamore will be the test bed.

I want stronger checking by findbugs and by the IDE, and it seems like I'm just not going to get it with the jnull annotations. The jnull annotations are also not as powerful as annotations that were written post JSR-308 integration into the JDK.

Make OSGi bundles

The recent move to the primogenitor forgot to add a configuration to produce OSGi bundles.

Theme change listeners?

Themes may change the size of the content area, so components need a chance to respond to this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.