Skip to content

Commit

Permalink
Curses (fixes #253) (#998)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Guillaume Nodet <[email protected]>
  • Loading branch information
cstamas and gnodet committed Jul 17, 2024
1 parent 4dcefdf commit bcc26f4
Show file tree
Hide file tree
Showing 30 changed files with 2,490 additions and 0 deletions.
67 changes: 67 additions & 0 deletions curses/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2002-2018, the original author or authors.
This software is distributable under the BSD license. See the terms of the
BSD license in the documentation provided with this software.
http://www.opensource.org/licenses/bsd-license.php
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.jline</groupId>
<artifactId>jline-parent</artifactId>
<version>3.27.0-SNAPSHOT</version>
</parent>

<artifactId>jline-curses</artifactId>
<name>JLine Curses</name>

<properties>
<automatic.module.name>org.jline.curses</automatic.module.name>
</properties>

<dependencies>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-terminal</artifactId>
</dependency>

<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-reader</artifactId>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<showWarnings>true</showWarnings>
<release>${java.release.version}</release>
<compilerArgs>
<arg>-Xlint:all,-options,-processing</arg>
</compilerArgs>
<fork>true</fork>
</configuration>
</plugin>

</plugins>
</build>

</project>
57 changes: 57 additions & 0 deletions curses/src/main/java/org/jline/curses/Component.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright (c) 2002-2018, the original author(s).
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* https://opensource.org/licenses/BSD-3-Clause
*/
package org.jline.curses;

import java.util.EnumSet;

import org.jline.terminal.MouseEvent;

public interface Component {

Position getPosition();

void setPosition(Position position);

Position getScreenPosition();

boolean isIn(int x, int y);

Size getSize();

void setSize(Size size);

Container getParent();

Size getPreferredSize();

boolean isFocused();

boolean isEnabled();

void enable(boolean enabled);

void focus();

void draw(Screen screen);

EnumSet<Behavior> getBehaviors();

enum Behavior {
NoFocus,
FullScreen,
NoDecoration,
CloseButton,
ManualLayout,
Popup
}

void handleMouse(MouseEvent event);

void handleInput(String input);
}
11 changes: 11 additions & 0 deletions curses/src/main/java/org/jline/curses/Constraint.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2002-2018, the original author(s).
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* https://opensource.org/licenses/BSD-3-Clause
*/
package org.jline.curses;

public interface Constraint {}
19 changes: 19 additions & 0 deletions curses/src/main/java/org/jline/curses/Container.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2002-2018, the original author(s).
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* https://opensource.org/licenses/BSD-3-Clause
*/
package org.jline.curses;

import java.util.Collection;

public interface Container extends Component {

/**
* Returns a read-only collection of all contained components.
*/
Collection<Component> getComponents();
}
Loading

0 comments on commit bcc26f4

Please sign in to comment.