├── .gitignore ├── .idea ├── .name ├── AndroidProjectSystem.xml ├── appInsightsSettings.xml ├── assetWizardSettings.xml ├── codeStyles │ └── Project.xml ├── compiler.xml ├── deploymentTargetDropDown.xml ├── deploymentTargetSelector.xml ├── encodings.xml ├── gradle.xml ├── jarRepositories.xml ├── migrations.xml ├── misc.xml ├── runConfigurations.xml └── vcs.xml ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── app ├── .gitignore ├── build.gradle ├── libsrc │ └── org │ │ └── exbin │ │ ├── auxiliary │ │ └── binary_data │ │ │ ├── BinaryData.java │ │ │ ├── BinaryDataInputStream.java │ │ │ ├── BinaryDataOutputStream.java │ │ │ ├── DataNotPresentException.java │ │ │ ├── DataOverflowException.java │ │ │ ├── DataRange.java │ │ │ ├── EditableBinaryData.java │ │ │ ├── EmptyBinaryData.java │ │ │ ├── FinishableStream.java │ │ │ ├── OutOfBoundsException.java │ │ │ ├── SeekableStream.java │ │ │ ├── SparseBinaryData.java │ │ │ ├── buffer │ │ │ ├── BufferData.java │ │ │ ├── BufferEditableData.java │ │ │ ├── DirectBufferData.java │ │ │ ├── DirectBufferEditableData.java │ │ │ └── paged │ │ │ │ └── BufferPagedData.java │ │ │ ├── delta │ │ │ ├── DataSegment.java │ │ │ ├── DataSource.java │ │ │ ├── DeltaDocument.java │ │ │ ├── DeltaDocumentChangedListener.java │ │ │ ├── DeltaDocumentInputStream.java │ │ │ ├── DeltaDocumentOutputStream.java │ │ │ ├── DeltaDocumentWindow.java │ │ │ ├── MemoryDataSource.java │ │ │ ├── MemorySegment.java │ │ │ ├── MemorySegmentCreator.java │ │ │ ├── SegmentsRepository.java │ │ │ ├── SourceSegment.java │ │ │ ├── SpaceSegment.java │ │ │ ├── file │ │ │ │ ├── DeltaDataPageWindow.java │ │ │ │ └── FileDataSource.java │ │ │ └── list │ │ │ │ ├── DefaultDoublyLinkedList.java │ │ │ │ ├── DoublyLinkedItem.java │ │ │ │ └── DoublyLinkedList.java │ │ │ ├── jna │ │ │ ├── JnaBufferData.java │ │ │ ├── JnaBufferEditableData.java │ │ │ └── paged │ │ │ │ └── JnaBufferPagedData.java │ │ │ └── paged │ │ │ ├── CustomizablePagedData.java │ │ │ ├── DataPageCreator.java │ │ │ └── PagedData.java │ │ └── bined │ │ ├── CaretOverlapMode.java │ │ ├── CharsetStreamTranslator.java │ │ ├── ClipboardHandlingMode.java │ │ ├── CodeAreaCaret.java │ │ ├── CodeAreaCaretListener.java │ │ ├── CodeAreaCaretPosition.java │ │ ├── CodeAreaControl.java │ │ ├── CodeAreaSection.java │ │ ├── CodeAreaSelection.java │ │ ├── CodeAreaUtils.java │ │ ├── CodeAreaZone.java │ │ ├── CodeCharactersCase.java │ │ ├── CodeType.java │ │ ├── DataChangedListener.java │ │ ├── DataProvider.java │ │ ├── DefaultCodeAreaCaretPosition.java │ │ ├── EditMode.java │ │ ├── EditModeChangedListener.java │ │ ├── EditOperation.java │ │ ├── PositionCodeType.java │ │ ├── RowWrappingMode.java │ │ ├── ScrollBarOrientation.java │ │ ├── ScrollBarVisibility.java │ │ ├── ScrollingListener.java │ │ ├── SelectionChangedListener.java │ │ ├── SelectionRange.java │ │ ├── basic │ │ ├── BasicBackgroundPaintMode.java │ │ ├── BasicCodeAreaLayout.java │ │ ├── BasicCodeAreaScrolling.java │ │ ├── BasicCodeAreaSection.java │ │ ├── BasicCodeAreaStructure.java │ │ ├── BasicCodeAreaZone.java │ │ ├── CodeAreaScrollPosition.java │ │ ├── CodeAreaViewMode.java │ │ ├── EnterKeyHandlingMode.java │ │ ├── HorizontalScrollUnit.java │ │ ├── MovementDirection.java │ │ ├── PositionScrollVisibility.java │ │ ├── ScrollBarVerticalScale.java │ │ ├── ScrollViewDimension.java │ │ ├── ScrollingDirection.java │ │ ├── SelectingMode.java │ │ ├── TabKeyHandlingMode.java │ │ └── VerticalScrollUnit.java │ │ ├── capability │ │ ├── BackgroundPaintCapable.java │ │ ├── BasicScrollingCapable.java │ │ ├── CaretCapable.java │ │ ├── CharsetCapable.java │ │ ├── ClipboardCapable.java │ │ ├── CodeCharactersCaseCapable.java │ │ ├── CodeTypeCapable.java │ │ ├── EditModeCapable.java │ │ ├── RowWrappingCapable.java │ │ ├── ScrollingCapable.java │ │ ├── SelectionCapable.java │ │ └── ViewModeCapable.java │ │ ├── color │ │ ├── BasicCodeAreaColorGroup.java │ │ ├── BasicCodeAreaDecorationColorType.java │ │ ├── CodeAreaBasicColors.java │ │ ├── CodeAreaColorGroup.java │ │ └── CodeAreaColorType.java │ │ └── operation │ │ ├── BinaryDataAbstractCommand.java │ │ ├── BinaryDataCommand.java │ │ ├── BinaryDataCommandPhase.java │ │ ├── BinaryDataCommandType.java │ │ ├── BinaryDataCompoundCommand.java │ │ ├── BinaryDataCompoundOperation.java │ │ ├── BinaryDataModifiedState.java │ │ ├── BinaryDataOperation.java │ │ ├── BinaryDataOperationType.java │ │ └── undo │ │ ├── BinaryDataAppendableCommand.java │ │ ├── BinaryDataAppendableOperation.java │ │ ├── BinaryDataAppendableUndoRedo.java │ │ ├── BinaryDataUndoRedo.java │ │ ├── BinaryDataUndoRedoChangeListener.java │ │ ├── BinaryDataUndoRedoState.java │ │ ├── BinaryDataUndoableCommand.java │ │ ├── BinaryDataUndoableOperation.java │ │ └── EmptyBinaryDataUndoRedo.java ├── proguard-rules.pro └── src │ ├── androidTest │ ├── java │ │ └── org │ │ │ └── exbin │ │ │ └── bined │ │ │ ├── CodeAreaTest.java │ │ │ ├── CodeAreaUtilsTest.java │ │ │ ├── HugeBinaryData.java │ │ │ ├── android │ │ │ └── basic │ │ │ │ ├── CodeAreaCommandClipboardTest.java │ │ │ │ ├── CodeAreaCommandEditTest.java │ │ │ │ ├── CodeAreaCommandMovementTest.java │ │ │ │ ├── CodeAreaComponentTest.java │ │ │ │ └── CodeAreaDataTest.java │ │ │ └── editor │ │ │ └── android │ │ │ └── ExampleInstrumentedTest.java │ └── resources │ │ └── org │ │ └── exbin │ │ └── bined │ │ └── resources │ │ └── test │ │ ├── 10bytes.dat │ │ ├── 5bytes.dat │ │ └── allbytes.dat │ └── main │ ├── AndroidManifest.xml │ ├── ic_launcher-playstore.png │ ├── java │ ├── com │ │ └── example │ │ │ └── customtouch │ │ │ └── widget │ │ │ └── TwoDimensionScrollView.java │ ├── java │ │ └── util │ │ │ └── Optional.java │ └── org │ │ └── exbin │ │ ├── bined │ │ ├── android │ │ │ ├── CodeAreaAndroidControl.java │ │ │ ├── CodeAreaAndroidUtils.java │ │ │ ├── CodeAreaCharAssessor.java │ │ │ ├── CodeAreaColorAssessor.java │ │ │ ├── CodeAreaCommandHandler.java │ │ │ ├── CodeAreaCore.java │ │ │ ├── CodeAreaPaintAssessor.java │ │ │ ├── CodeAreaPaintState.java │ │ │ ├── CodeAreaPainter.java │ │ │ ├── Font.java │ │ │ ├── basic │ │ │ │ ├── BasicCodeAreaDimensions.java │ │ │ │ ├── BasicCodeAreaMetrics.java │ │ │ │ ├── BasicCodeAreaVisibility.java │ │ │ │ ├── CodeArea.java │ │ │ │ ├── DefaultCodeArea.java │ │ │ │ ├── DefaultCodeAreaCaret.java │ │ │ │ ├── DefaultCodeAreaCharAssessor.java │ │ │ │ ├── DefaultCodeAreaColorAssessor.java │ │ │ │ ├── DefaultCodeAreaCommandHandler.java │ │ │ │ ├── DefaultCodeAreaMouseListener.java │ │ │ │ ├── DefaultCodeAreaPainter.java │ │ │ │ ├── DefaultCodeAreaScrollPane.java │ │ │ │ └── color │ │ │ │ │ ├── BasicCodeAreaColorsProfile.java │ │ │ │ │ ├── BasicColorsCapableCodeAreaPainter.java │ │ │ │ │ └── CodeAreaColorsProfile.java │ │ │ └── capability │ │ │ │ ├── BasicColorsCapable.java │ │ │ │ ├── CharAssessorPainterCapable.java │ │ │ │ ├── ColorAssessorPainterCapable.java │ │ │ │ └── FontCapable.java │ │ ├── editor │ │ │ └── android │ │ │ │ ├── AboutDialog.java │ │ │ │ ├── ApplicationContext.java │ │ │ │ ├── BinEdFileHandler.java │ │ │ │ ├── BinaryStatusHandler.java │ │ │ │ ├── CodeAreaTableMapAssessor.java │ │ │ │ ├── CompatUtils.java │ │ │ │ ├── ContentDataSource.java │ │ │ │ ├── DeltaDataPageWindow.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── SettingsActivity.java │ │ │ │ ├── SinglePreferenceFragment.java │ │ │ │ ├── inspector │ │ │ │ ├── BasicValuesInspector.java │ │ │ │ └── BasicValuesPositionColorModifier.java │ │ │ │ ├── options │ │ │ │ ├── CodeAreaOptions.java │ │ │ │ ├── DataInspectorMode.java │ │ │ │ ├── EditorOptions.java │ │ │ │ ├── KeysPanelMode.java │ │ │ │ ├── MainOptions.java │ │ │ │ ├── StatusOptions.java │ │ │ │ ├── TextEncodingOptions.java │ │ │ │ ├── TextFontOptions.java │ │ │ │ ├── Theme.java │ │ │ │ └── impl │ │ │ │ │ └── StatusOptionsImpl.java │ │ │ │ ├── preference │ │ │ │ ├── AppearanceFragment.java │ │ │ │ ├── BinaryEditorPreferences.java │ │ │ │ ├── CodeAreaPreferences.java │ │ │ │ ├── EditorPreferences.java │ │ │ │ ├── EncodingPreference.java │ │ │ │ ├── FontPreference.java │ │ │ │ ├── HeaderFragment.java │ │ │ │ ├── MainPreferences.java │ │ │ │ ├── Preferences.java │ │ │ │ ├── PreferencesWrapper.java │ │ │ │ ├── StatusPreferences.java │ │ │ │ ├── TextEncodingPreferences.java │ │ │ │ ├── TextFontPreferences.java │ │ │ │ └── ViewFragment.java │ │ │ │ └── search │ │ │ │ ├── BinarySearch.java │ │ │ │ ├── BinarySearchService.java │ │ │ │ ├── BinarySearchServiceImpl.java │ │ │ │ ├── ReplaceParameters.java │ │ │ │ ├── SearchCondition.java │ │ │ │ └── SearchParameters.java │ │ ├── highlight │ │ │ └── android │ │ │ │ ├── NonAsciiCodeAreaColorAssessor.java │ │ │ │ ├── NonprintablesCodeAreaAssessor.java │ │ │ │ ├── SearchCodeAreaColorAssessor.java │ │ │ │ ├── SearchMatch.java │ │ │ │ └── color │ │ │ │ ├── CodeAreaColorizationColorType.java │ │ │ │ ├── CodeAreaMatchColorType.java │ │ │ │ ├── CodeAreaNonprintablesColorType.java │ │ │ │ ├── ColorizationCodeAreaColorsGroup.java │ │ │ │ ├── MatchCodeAreaColorsGroup.java │ │ │ │ └── NonprintableCodeAreaColorsGroup.java │ │ └── operation │ │ │ └── android │ │ │ ├── CharEditDataOperation.java │ │ │ ├── CodeAreaCompoundOperation.java │ │ │ ├── CodeAreaOperation.java │ │ │ ├── CodeAreaOperationCommandHandler.java │ │ │ ├── CodeAreaOperationType.java │ │ │ ├── CodeAreaUndoRedo.java │ │ │ ├── CodeEditDataOperation.java │ │ │ ├── DeleteCharEditDataOperation.java │ │ │ ├── DeleteCodeEditDataOperation.java │ │ │ ├── InsertCharEditDataOperation.java │ │ │ ├── InsertCodeEditDataOperation.java │ │ │ ├── InsertDataOperation.java │ │ │ ├── ModifyDataOperation.java │ │ │ ├── OverwriteCharEditDataOperation.java │ │ │ ├── OverwriteCodeEditDataOperation.java │ │ │ ├── RemoveDataOperation.java │ │ │ └── command │ │ │ ├── CodeAreaCommand.java │ │ │ ├── CodeAreaCommandType.java │ │ │ ├── CodeAreaCompoundCommand.java │ │ │ ├── DeleteSelectionCommand.java │ │ │ ├── EditCharDataCommand.java │ │ │ ├── EditCodeDataCommand.java │ │ │ ├── EditDataCommand.java │ │ │ ├── InsertDataCommand.java │ │ │ ├── ModifyDataCommand.java │ │ │ ├── OpCodeAreaCommand.java │ │ │ ├── PasteDataCommand.java │ │ │ └── RemoveDataCommand.java │ │ └── framework │ │ └── bined │ │ ├── BinEdCodeAreaAssessor.java │ │ ├── BinaryStatusApi.java │ │ ├── FileHandlingMode.java │ │ ├── StatusCursorPositionFormat.java │ │ └── StatusDocumentSizeFormat.java │ └── res │ ├── color │ └── menu_icon_state.xml │ ├── drawable │ ├── app_icon.png │ ├── banner.png │ ├── ic_exit_24.xml │ ├── ic_eye_24.xml │ ├── ic_file_new_24.xml │ ├── ic_file_open_24.xml │ ├── ic_file_save_24.xml │ ├── ic_file_save_as_24.xml │ ├── ic_info_24.xml │ ├── ic_language_24.xml │ ├── ic_launcher_foreground.xml │ ├── ic_palette_24.xml │ ├── ic_redo_24.xml │ ├── ic_search_24.xml │ ├── ic_settings_24.xml │ └── ic_undo_24.xml │ ├── layout │ ├── about_view.xml │ ├── activity_file.xml │ ├── activity_main.xml │ ├── basic_values_inspector.xml │ ├── content_main.xml │ ├── control_main.xml │ ├── settings_activity.xml │ └── status_panel.xml │ ├── menu │ └── menu_main.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── values-cs │ ├── arrays.xml │ └── strings.xml │ ├── values-hi │ ├── arrays.xml │ └── strings.xml │ ├── values-night │ ├── colors.xml │ └── styles.xml │ ├── values-pt │ ├── arrays.xml │ └── strings.xml │ ├── values-tr │ ├── arrays.xml │ └── strings.xml │ ├── values-zh-rCN │ ├── arrays.xml │ └── strings.xml │ ├── values │ ├── arrays.xml │ ├── colors.xml │ ├── ic_launcher_background.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ ├── backup_rules.xml │ ├── header_preferences.xml │ ├── main_preferences.xml │ └── view_preferences.xml ├── build.gradle ├── changes.txt ├── fastlane └── metadata │ └── android │ └── en-US │ ├── changelogs │ ├── 10.txt │ ├── 11.txt │ ├── 13.txt │ ├── 15.txt │ ├── 4.txt │ ├── 5.txt │ └── 8.txt │ ├── full_description.txt │ ├── images │ ├── icon.png │ ├── phoneScreenshots │ │ ├── 1.png │ │ └── 2.png │ ├── sevenInchScreenshots │ │ └── 1.png │ ├── tenInchScreenshots │ │ └── 1.png │ └── tvScreenshots │ │ └── 1.png │ ├── short_description.txt │ └── title.txt ├── file_picker ├── .gitignore ├── README.md ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── rustamg │ │ └── filedialogs │ │ ├── ExtensionFilter.java │ │ ├── FileDialog.java │ │ ├── FileListAdapter.java │ │ ├── OpenFileDialog.java │ │ ├── SaveFileDialog.java │ │ └── utils │ │ ├── KeyboardUtils.java │ │ └── TextUtils.java │ └── res │ ├── drawable-hdpi │ ├── ic_action_accept.png │ ├── ic_cross.png │ ├── ic_file.png │ └── ic_folder.png │ ├── drawable-mdpi │ ├── ic_action_accept.png │ ├── ic_cross.png │ ├── ic_file.png │ └── ic_folder.png │ ├── drawable-xhdpi │ ├── ic_action_accept.png │ ├── ic_cross.png │ ├── ic_file.png │ └── ic_folder.png │ ├── drawable-xxhdpi │ ├── ic_action_accept.png │ ├── ic_cross.png │ ├── ic_file.png │ └── ic_folder.png │ ├── layout │ ├── dialog_open_file.xml │ ├── dialog_save_file.xml │ └── list_item_file.xml │ ├── menu │ └── dialog_save.xml │ └── values │ ├── attrs.xml │ ├── dimens.xml │ └── strings.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── images └── editor_screenshot.png └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | /.idea/deploymentTargetSelector.xml 8 | /.idea/caches/ 9 | .DS_Store 10 | /build 11 | /app/build 12 | /captures 13 | .externalNativeBuild 14 | *~ 15 | /resources/private/ 16 | /.nb-gradle/ 17 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | BinEd -------------------------------------------------------------------------------- /.idea/AndroidProjectSystem.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/appInsightsSettings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/deploymentTargetDropDown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/deploymentTargetSelector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /.idea/migrations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | BinEd - Hex Editor 2 | ================== 3 | 4 | Editor for binary data (hex viewer/editor) written in Java. 5 | 6 | Homepage: https://bined.exbin.org/android 7 | 8 | [Get it on F-Droid](https://f-droid.org/packages/org.exbin.bined.editor.android/) [Get it on Google Play](https://play.google.com/store/apps/details?id=org.exbin.bined.editor.android) 9 | 10 | Or download the latest APK from the [Releases Section](https://github.com/exbin/bined-android/releases/latest). 11 | 12 | Screenshot 13 | ---------- 14 | 15 | ![BinEd-Editor Screenshot](images/editor_screenshot.png?raw=true) 16 | 17 | Features 18 | -------- 19 | 20 | * Visualize data as numerical (hexadecimal) codes and text representation 21 | * Codes can be also binary, octal or decimal 22 | * Support for Unicode, UTF-8 and other charsets 23 | * Insert and overwrite edit modes 24 | * TODO: Searching for text / hexadecimal code with matching highlighting 25 | * Support for undo/redo 26 | * Support for files with size up to exabytes (in partial file mode) 27 | 28 | Compiling 29 | --------- 30 | 31 | To compile project and build apk you need installed Java JDK 17 or later and run: 32 | 33 | ./gradlew assembleRelease 34 | 35 | or on Windows: 36 | 37 | gradlew.bat assembleRelease 38 | 39 | To modify this project, Android Studio is recommended. 40 | https://developer.android.com/studio/ 41 | 42 | When using Android Studio modify following line in build.gradle file to avoid legacy errors: 43 | 44 | def playStore = true 45 | 46 | License 47 | ------- 48 | 49 | Apache License, Version 2.0 - see LICENSE.txt 50 | 51 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/auxiliary/binary_data/DataOverflowException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.auxiliary.binary_data; 17 | 18 | import javax.annotation.Nullable; 19 | 20 | /** 21 | * Exception for overflow situation where more data is inserted/added than it is 22 | * allowed to handle. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | public class DataOverflowException extends RuntimeException { 27 | 28 | public DataOverflowException() { 29 | } 30 | 31 | public DataOverflowException(@Nullable String message) { 32 | super(message); 33 | } 34 | 35 | public DataOverflowException(@Nullable String message, @Nullable Throwable cause) { 36 | super(message, cause); 37 | } 38 | 39 | public DataOverflowException(@Nullable Throwable cause) { 40 | super(cause); 41 | } 42 | 43 | public DataOverflowException(@Nullable String message, @Nullable Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 44 | super(message, cause, enableSuppression, writableStackTrace); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/auxiliary/binary_data/DataRange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.auxiliary.binary_data; 17 | 18 | import javax.annotation.concurrent.Immutable; 19 | 20 | /** 21 | * Simple representation of data range. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | @Immutable 26 | public class DataRange { 27 | 28 | protected final long startPosition; 29 | protected final long endPosition; 30 | 31 | public DataRange(long startPosition, long endPosition) { 32 | this.startPosition = startPosition; 33 | this.endPosition = endPosition; 34 | } 35 | 36 | public long getStartPosition() { 37 | return startPosition; 38 | } 39 | 40 | public long getEndPosition() { 41 | return endPosition; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/auxiliary/binary_data/FinishableStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.auxiliary.binary_data; 17 | 18 | import java.io.IOException; 19 | 20 | /** 21 | * Interface for finish-able stream - allows to skip/process data to identify 22 | * size of remaining data. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | public interface FinishableStream { 27 | 28 | /** 29 | * Reads remaining data and returns size of all data processed by this 30 | * stream. 31 | * 32 | * @return size of data in bytes 33 | * @throws IOException if input/output error occurs 34 | */ 35 | long finish() throws IOException; 36 | 37 | /** 38 | * Returns size of data processed so far. 39 | * 40 | * @return size of data in bytes 41 | */ 42 | long getProcessedSize(); 43 | } 44 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/auxiliary/binary_data/OutOfBoundsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.auxiliary.binary_data; 17 | 18 | import javax.annotation.Nullable; 19 | 20 | /** 21 | * Exception for out of bounds issues with binary data manipulation operations. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | public class OutOfBoundsException extends RuntimeException { 26 | 27 | public OutOfBoundsException() { 28 | } 29 | 30 | public OutOfBoundsException(@Nullable String message) { 31 | super(message); 32 | } 33 | 34 | public OutOfBoundsException(@Nullable String message, @Nullable Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | public OutOfBoundsException(@Nullable Throwable cause) { 39 | super(cause); 40 | } 41 | 42 | public OutOfBoundsException(@Nullable String message, @Nullable Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 43 | super(message, cause, enableSuppression, writableStackTrace); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/auxiliary/binary_data/SeekableStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.auxiliary.binary_data; 17 | 18 | import java.io.IOException; 19 | 20 | /** 21 | * Interface for seekable stream - allows to change current position. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | public interface SeekableStream { 26 | 27 | /** 28 | * Moves position in the stream to given position from the start of the 29 | * stream. 30 | * 31 | * @param position target position 32 | * @throws IOException if input/output error 33 | */ 34 | void seek(long position) throws IOException; 35 | 36 | /** 37 | * Returns length of the stream. 38 | * 39 | * @return length of the stream in bytes, -1 if unable to determine 40 | */ 41 | long getStreamSize(); 42 | } 43 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/auxiliary/binary_data/delta/DeltaDocumentChangedListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.auxiliary.binary_data.delta; 17 | 18 | import javax.annotation.ParametersAreNonnullByDefault; 19 | 20 | /** 21 | * Listener for delta document data changes. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | @ParametersAreNonnullByDefault 26 | public interface DeltaDocumentChangedListener { 27 | 28 | /** 29 | * Change in data occurred. 30 | * 31 | * @param window updated window for reference 32 | */ 33 | void dataChanged(DeltaDocumentWindow window); 34 | } 35 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/auxiliary/binary_data/delta/MemorySegmentCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.auxiliary.binary_data.delta; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.auxiliary.binary_data.EditableBinaryData; 21 | 22 | /** 23 | * Memory segment creator. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public interface MemorySegmentCreator { 29 | 30 | /** 31 | * Creates new memory segment. 32 | * 33 | * @return data page 34 | */ 35 | @Nonnull 36 | EditableBinaryData createSegment(); 37 | } 38 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/auxiliary/binary_data/delta/SpaceSegment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.auxiliary.binary_data.delta; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | 21 | /** 22 | * Space placeholder segment. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | @ParametersAreNonnullByDefault 27 | public class SpaceSegment extends DataSegment { 28 | 29 | private long length; 30 | 31 | public SpaceSegment(long length) { 32 | this.length = length; 33 | } 34 | 35 | @Override 36 | public long getStartPosition() { 37 | return 0; 38 | } 39 | 40 | public void setStartPosition(long startPosition) { 41 | throw new IllegalStateException("Unable to set start position on space placeholder segment"); 42 | } 43 | 44 | @Override 45 | public long getLength() { 46 | return length; 47 | } 48 | 49 | public void setLength(long length) { 50 | this.length = length; 51 | } 52 | 53 | public byte getByte(long position) { 54 | throw new IllegalStateException("Unable to read data from space placeholder segment"); 55 | } 56 | 57 | @Nonnull 58 | @Override 59 | public DataSegment copy() { 60 | return new SpaceSegment(length); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/auxiliary/binary_data/delta/list/DoublyLinkedItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.auxiliary.binary_data.delta.list; 17 | 18 | import javax.annotation.Nullable; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | 21 | /** 22 | * Interface for item of doubly linked list. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | * @param instance class 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public interface DoublyLinkedItem { 29 | 30 | /** 31 | * Returns next linked item. 32 | * 33 | * @return next item 34 | */ 35 | @Nullable 36 | T getNext(); 37 | 38 | /** 39 | * Sets next linked item. 40 | * 41 | * @param next next item 42 | */ 43 | void setNext(@Nullable T next); 44 | 45 | /** 46 | * Returns previous linked item. 47 | * 48 | * @return next item 49 | */ 50 | @Nullable 51 | T getPrev(); 52 | 53 | /** 54 | * Sets previous linked item. 55 | * 56 | * @param previous previous item 57 | */ 58 | void setPrev(@Nullable T previous); 59 | } 60 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/auxiliary/binary_data/delta/list/DoublyLinkedList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.auxiliary.binary_data.delta.list; 17 | 18 | import java.util.List; 19 | import javax.annotation.Nullable; 20 | import javax.annotation.ParametersAreNonnullByDefault; 21 | 22 | /** 23 | * Doubly linked list of items. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | * @param doubly linked list item 27 | */ 28 | @ParametersAreNonnullByDefault 29 | public interface DoublyLinkedList extends List { 30 | 31 | /** 32 | * Returns first item of the list. 33 | * 34 | * @return first item 35 | */ 36 | @Nullable 37 | T first(); 38 | 39 | /** 40 | * Returns last item of the list. 41 | * 42 | * @return last item 43 | */ 44 | @Nullable 45 | T last(); 46 | 47 | /** 48 | * Returns item next to given item. 49 | * 50 | * @param item item 51 | * @return next item or null 52 | */ 53 | @Nullable 54 | T nextTo(T item); 55 | 56 | /** 57 | * Returns item previous to given item. 58 | * 59 | * @param item item 60 | * @return previous item or null 61 | */ 62 | @Nullable 63 | T prevTo(T item); 64 | } 65 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/auxiliary/binary_data/paged/CustomizablePagedData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.auxiliary.binary_data.paged; 17 | 18 | import java.util.Optional; 19 | import javax.annotation.Nonnull; 20 | import javax.annotation.Nullable; 21 | 22 | /** 23 | * Paged data with support for customizable page creator. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | public interface CustomizablePagedData extends PagedData { 28 | 29 | /** 30 | * Returns data page creator. 31 | * 32 | * @return data page creator 33 | */ 34 | @Nonnull 35 | Optional getDataPageCreator(); 36 | 37 | /** 38 | * Sets data page creator. 39 | * 40 | * @param dataPageCreator data page creator 41 | */ 42 | void setDataPageCreator(@Nullable DataPageCreator dataPageCreator); 43 | } 44 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/auxiliary/binary_data/paged/DataPageCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.auxiliary.binary_data.paged; 17 | 18 | import javax.annotation.Nonnull; 19 | import org.exbin.auxiliary.binary_data.EditableBinaryData; 20 | 21 | /** 22 | * Data page creator. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | public interface DataPageCreator { 27 | 28 | /** 29 | * Creates new data page with specified size. 30 | * 31 | * @param dataSize data size 32 | * @return data page 33 | */ 34 | @Nonnull 35 | EditableBinaryData createPage(int dataSize); 36 | } 37 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/CaretOverlapMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Enumeration of cursor caret overlapping modes. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum CaretOverlapMode { 24 | /** 25 | * Caret must be fully visible in visible area. 26 | */ 27 | FULLY_VISIBLE, 28 | /** 29 | * Caret can be partially visible in visible area. 30 | */ 31 | PARTIAL_OVERLAP 32 | } 33 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/ClipboardHandlingMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Enumeration of clipboard handling modes. 20 | *

21 | * Used to specify what to do with basic clipboard actions like cut, copy, paste 22 | * and delete. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | public enum ClipboardHandlingMode { 27 | 28 | /** 29 | * Ignore clipboard actions. 30 | */ 31 | IGNORE, 32 | /** 33 | * Process clipboard actions using default operations. 34 | */ 35 | PROCESS 36 | } 37 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/CodeAreaCaretListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | import javax.annotation.ParametersAreNonnullByDefault; 19 | 20 | /** 21 | * Interface for code area caret change listener. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | @ParametersAreNonnullByDefault 26 | public interface CodeAreaCaretListener { 27 | 28 | /** 29 | * Fires notification each time caret is moved or section is changed. 30 | * 31 | * @param caretPosition caret position 32 | */ 33 | void caretMoved(CodeAreaCaretPosition caretPosition); 34 | } 35 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/CodeAreaCaretPosition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | import java.util.Optional; 19 | import javax.annotation.Nonnull; 20 | 21 | /** 22 | * Specifies caret position as combination of data position, section and code 23 | * offset of code representation. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | public interface CodeAreaCaretPosition { 28 | 29 | /** 30 | * Returns specific byte position in the document. 31 | * 32 | * @return data position 33 | */ 34 | long getDataPosition(); 35 | 36 | /** 37 | * Returns character offset position in the code on current position. 38 | * 39 | * @return code offset 40 | */ 41 | int getCodeOffset(); 42 | 43 | /** 44 | * Returns active code area section. 45 | * 46 | * @return section 47 | */ 48 | @Nonnull 49 | Optional getSection(); 50 | 51 | /** 52 | * Resets caret position. 53 | */ 54 | void reset(); 55 | } 56 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/CodeAreaControl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Code Area control interface. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public interface CodeAreaControl extends DataProvider { 24 | 25 | /** 26 | * Copies selection to clipboard. 27 | */ 28 | void copy(); 29 | 30 | /** 31 | * Cuts selection to clipboard. 32 | */ 33 | void cut(); 34 | 35 | /** 36 | * Pastes content of the clipboard. 37 | */ 38 | void paste(); 39 | 40 | /** 41 | * Deletes selected section. 42 | */ 43 | void delete(); 44 | 45 | /** 46 | * Expands selection to all data. 47 | */ 48 | void selectAll(); 49 | 50 | /** 51 | * Returns true if content of the clipboard is valid for paste operation. 52 | * 53 | * @return true if paste can proceed 54 | */ 55 | boolean canPaste(); 56 | 57 | /** 58 | * Returns true if selection is not empty. 59 | * 60 | * @return true if selection is not empty 61 | */ 62 | boolean hasSelection(); 63 | 64 | /** 65 | * Clears data selection. 66 | */ 67 | void clearSelection(); 68 | } 69 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/CodeAreaSection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Code area section interface. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public interface CodeAreaSection { 24 | } 25 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/CodeAreaZone.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Code area zone identifier. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public interface CodeAreaZone { 24 | } 25 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/CodeCharactersCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Enumeration of code characters case. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum CodeCharactersCase { 24 | 25 | /** 26 | * Lower case, eg. a, b, c, d, e, f. 27 | */ 28 | LOWER, 29 | /** 30 | * Upper case, eg. A, B, C, D, E, F. 31 | */ 32 | UPPER 33 | } 34 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/DataChangedListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Interface for data change listener. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public interface DataChangedListener { 24 | 25 | /** 26 | * Fires notification each time data is modified. 27 | */ 28 | void dataChanged(); 29 | } 30 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/DataProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | import javax.annotation.Nonnull; 19 | import org.exbin.auxiliary.binary_data.BinaryData; 20 | 21 | /** 22 | * Data provider. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | public interface DataProvider { 27 | 28 | /** 29 | * Returns data or null. 30 | * 31 | * @return binary data 32 | */ 33 | @Nonnull 34 | BinaryData getContentData(); 35 | 36 | /** 37 | * Returns size of data or 0 if no data is present. 38 | * 39 | * @return size of data 40 | */ 41 | long getDataSize(); 42 | } 43 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/EditMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Enumeration of edit modes. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum EditMode { 24 | 25 | /** 26 | * Document cannot be changed. 27 | */ 28 | READ_ONLY, 29 | /** 30 | * Default mode expanding data when necessary. 31 | *

32 | * Document is extended by size of the inserted data or when replacing data 33 | * overflows end of the file. 34 | */ 35 | EXPANDING, 36 | /** 37 | * Data are inserted and replaced, but size of the file remains the same 38 | * cutting out excessive data. 39 | */ 40 | CAPPED, 41 | /** 42 | * Only overwrite edit mode is allowed and size of document cannot be 43 | * changed. 44 | */ 45 | INPLACE 46 | } 47 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/EditModeChangedListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | import javax.annotation.ParametersAreNonnullByDefault; 19 | 20 | /** 21 | * Interface for edit mode change listener. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | @ParametersAreNonnullByDefault 26 | public interface EditModeChangedListener { 27 | 28 | /** 29 | * Fires notification each time edit mode is changed. 30 | * 31 | * @param editMode new edit mode 32 | * @param editOperation new active edit operation type 33 | */ 34 | void editModeChanged(EditMode editMode, EditOperation editOperation); 35 | } 36 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/EditOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Enumeration of edit operations. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum EditOperation { 24 | 25 | /** 26 | * Data are inserted at cursor position. 27 | *

28 | * Document is extended by size of the inserted data, data at cursor 29 | * position moved forward to provide space and then inserted data are stored 30 | * in this new space. 31 | */ 32 | INSERT, 33 | /** 34 | * Data are replaced at cursor position. 35 | *

36 | * If size of data is greater than size of the document and edit is not in 37 | * "overwrite only" mode, document is extended so that inserted data will 38 | * fit in. 39 | */ 40 | OVERWRITE 41 | } 42 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/RowWrappingMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Row wrapping mode. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum RowWrappingMode { 24 | 25 | /** 26 | * Rows are not wrapped to visible area. 27 | */ 28 | NO_WRAPPING, 29 | /** 30 | * Rows are wrapped to visible area. 31 | */ 32 | WRAPPING 33 | } 34 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/ScrollBarOrientation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Enumeration of scrollbar orientation variants. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum ScrollBarOrientation { 24 | HORIZONTAL, VERTICAL 25 | } 26 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/ScrollBarVisibility.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Enumeration of scrollbar visibility modes. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum ScrollBarVisibility { 24 | 25 | /** 26 | * Never show scrollbars even when area is bigger then available space. 27 | */ 28 | NEVER, 29 | /** 30 | * Show scrollbars only if area is bigger then available space. 31 | */ 32 | IF_NEEDED, 33 | /** 34 | * Always show scrollbar regardless of the available space. 35 | */ 36 | ALWAYS 37 | } 38 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/ScrollingListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Interface for scrolling listener. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public interface ScrollingListener { 24 | 25 | /** 26 | * Fires notification each time component is scrolled. 27 | */ 28 | void scrolled(); 29 | } 30 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/SelectionChangedListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined; 17 | 18 | /** 19 | * Interface for selection change listener. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public interface SelectionChangedListener { 24 | 25 | /** 26 | * Fires notification each time selection range changes or selection is 27 | * created or cleared. 28 | */ 29 | void selectionChanged(); 30 | } 31 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/BasicBackgroundPaintMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | /** 19 | * Border paint modes for basic painter. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum BasicBackgroundPaintMode { 24 | /** 25 | * Border is not painted. 26 | */ 27 | TRANSPARENT, 28 | /** 29 | * Border is painted with single solid color. 30 | */ 31 | PLAIN, 32 | /** 33 | * Rows are alternately painted with background and alternate background 34 | * color. 35 | */ 36 | STRIPED 37 | } 38 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/BasicCodeAreaSection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | import org.exbin.bined.CodeAreaSection; 19 | 20 | /** 21 | * Enumeration of basic cursor position section. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | public enum BasicCodeAreaSection implements CodeAreaSection { 26 | 27 | /** 28 | * Section of code area with codes for binary data representation. 29 | */ 30 | CODE_MATRIX, 31 | /** 32 | * Section of code area with textual preview characters. 33 | */ 34 | TEXT_PREVIEW 35 | } 36 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/BasicCodeAreaZone.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | import org.exbin.bined.CodeAreaZone; 19 | 20 | /** 21 | * Enumeration of basic code area zones. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | public enum BasicCodeAreaZone implements CodeAreaZone { 26 | 27 | UNKNOWN, 28 | HEADER, 29 | ROW_POSITIONS, 30 | CODE_AREA, 31 | HORIZONTAL_SCROLLBAR, 32 | VERTICAL_SCROLLBAR, 33 | SCROLLBAR_CORNER, 34 | TOP_LEFT_CORNER, 35 | BOTTOM_LEFT_CORNER 36 | } 37 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/CodeAreaViewMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | /** 19 | * Enumeration of supported view modes. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum CodeAreaViewMode { 24 | 25 | /** 26 | * Show both numerical codes and textual preview. 27 | */ 28 | DUAL, 29 | /** 30 | * Show numerical codes only. 31 | */ 32 | CODE_MATRIX, 33 | /** 34 | * Show textual preview only. 35 | */ 36 | TEXT_PREVIEW 37 | } 38 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/EnterKeyHandlingMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | 21 | /** 22 | * Enumeration of modes for enter key handling. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | @ParametersAreNonnullByDefault 27 | public enum EnterKeyHandlingMode { 28 | /** 29 | * Handle enter using java platform detection (default). 30 | */ 31 | PLATFORM_SPECIFIC(""), 32 | /** 33 | * Single character 13 (0d). 34 | */ 35 | CR("\r"), 36 | /** 37 | * Single character 10 (0a). 38 | */ 39 | LF("\n"), 40 | /** 41 | * Two characters 13 10 (0d0a). 42 | */ 43 | CRLF("\r\n"), 44 | /** 45 | * Don't handle enter key. 46 | */ 47 | IGNORE(""); 48 | 49 | private final String sequence; 50 | 51 | private EnterKeyHandlingMode(String sequence) { 52 | this.sequence = sequence; 53 | } 54 | 55 | @Nonnull 56 | public String getSequence() { 57 | if (this == PLATFORM_SPECIFIC) { 58 | return System.lineSeparator(); 59 | } 60 | 61 | return sequence; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/HorizontalScrollUnit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | /** 19 | * Enumeration of horizontal scrolling unit sizes. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum HorizontalScrollUnit { 24 | /** 25 | * Scroll per whole character. 26 | */ 27 | CHARACTER, 28 | /** 29 | * Scroll per pixel. 30 | */ 31 | PIXEL 32 | } 33 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/MovementDirection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | /** 19 | * Enumeration of supported movement directions. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum MovementDirection { 24 | UP, DOWN, LEFT, RIGHT, 25 | PAGE_UP, PAGE_DOWN, 26 | ROW_START, ROW_END, DOC_START, DOC_END, 27 | SWITCH_SECTION 28 | } 29 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/PositionScrollVisibility.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | /** 19 | * Enumeration of possible visibility states of caret position relative to 20 | * scrolling area. 21 | * 22 | * @author ExBin Project (https://exbin.org) 23 | */ 24 | public enum PositionScrollVisibility { 25 | 26 | /** 27 | * Given position is fully visible in current scroll window. 28 | */ 29 | VISIBLE, 30 | /** 31 | * Given position is partially visible in current scroll window. 32 | */ 33 | PARTIAL, 34 | /** 35 | * Given position is not visible in current scroll window. 36 | */ 37 | NOT_VISIBLE 38 | } 39 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/ScrollBarVerticalScale.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | /** 19 | * Enumeration of vertical scaling modes. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum ScrollBarVerticalScale { 24 | /** 25 | * Normal ratio 1 on 1. 26 | */ 27 | NORMAL, 28 | /** 29 | * Height is more than available range/precision of the scrollbar and must 30 | * be scaled. 31 | */ 32 | SCALED 33 | } 34 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/ScrollViewDimension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | /** 19 | * Scrolling view dimensions. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public class ScrollViewDimension { 24 | 25 | protected int dataViewWidth; 26 | protected int dataViewHeight; 27 | protected int width; 28 | protected int height; 29 | 30 | public ScrollViewDimension() { 31 | } 32 | 33 | public void setDimension(int dataViewWidth, int dataViewHeight, int width, int height) { 34 | this.dataViewWidth = dataViewWidth; 35 | this.dataViewHeight = dataViewHeight; 36 | this.width = width; 37 | this.height = height; 38 | } 39 | 40 | public int getDataViewWidth() { 41 | return dataViewWidth; 42 | } 43 | 44 | public int getDataViewHeight() { 45 | return dataViewHeight; 46 | } 47 | 48 | public int getWidth() { 49 | return width; 50 | } 51 | 52 | public int getHeight() { 53 | return height; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/ScrollingDirection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | /** 19 | * Enumeration of supported scrolling directions. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum ScrollingDirection { 24 | UP, DOWN, LEFT, RIGHT, 25 | PAGE_UP, PAGE_DOWN 26 | } 27 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/SelectingMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | /** 19 | * Enumeration of selection selecting modes. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum SelectingMode { 24 | /** 25 | * Selection is not updated. 26 | */ 27 | NONE, 28 | /** 29 | * Selection is updated. 30 | */ 31 | SELECTING 32 | } 33 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/TabKeyHandlingMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | /** 19 | * Enumeration of modes for tab key handling. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum TabKeyHandlingMode { 24 | /** 25 | * Handle tab key using java platform detection (default). 26 | */ 27 | PLATFORM_SPECIFIC, 28 | /** 29 | * Insert tab character \t. 30 | */ 31 | INSERT_TAB, 32 | /** 33 | * Insert space characters. 34 | */ 35 | INSERT_SPACES, 36 | /** 37 | * Jump to next code area section. 38 | */ 39 | CYCLE_TO_NEXT_SECTION, 40 | /** 41 | * Jump to previous code area section. 42 | */ 43 | CYCLE_TO_PREVIOUS_SECTION, 44 | /** 45 | * Don't handle tab key. 46 | */ 47 | IGNORE; 48 | } 49 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/basic/VerticalScrollUnit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.basic; 17 | 18 | /** 19 | * Enumeration of vertical scrolling unit sizes. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum VerticalScrollUnit { 24 | /** 25 | * Scroll per whole line. 26 | */ 27 | ROW, 28 | /** 29 | * Scroll per pixel. 30 | */ 31 | PIXEL 32 | } 33 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/capability/BackgroundPaintCapable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.capability; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.basic.BasicBackgroundPaintMode; 21 | 22 | /** 23 | * Support for background paint mode capability. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public interface BackgroundPaintCapable { 29 | 30 | /** 31 | * Returns current background paint mode. 32 | * 33 | * @return background paint mode 34 | */ 35 | @Nonnull 36 | BasicBackgroundPaintMode getBackgroundPaintMode(); 37 | 38 | /** 39 | * Sets current background paint mode. 40 | * 41 | * @param borderPaintMode background paint mode 42 | */ 43 | void setBackgroundPaintMode(BasicBackgroundPaintMode borderPaintMode); 44 | } 45 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/capability/CharsetCapable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.capability; 17 | 18 | import java.nio.charset.Charset; 19 | import javax.annotation.Nonnull; 20 | import javax.annotation.ParametersAreNonnullByDefault; 21 | 22 | /** 23 | * Support for charset capability. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public interface CharsetCapable { 29 | 30 | /** 31 | * Returns currently used charset. 32 | * 33 | * @return charset 34 | */ 35 | @Nonnull 36 | Charset getCharset(); 37 | 38 | /** 39 | * Sets charset to use for characters decoding. 40 | * 41 | * @param charset charset 42 | */ 43 | void setCharset(Charset charset); 44 | } 45 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/capability/ClipboardCapable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.capability; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.ClipboardHandlingMode; 21 | 22 | /** 23 | * Support for clipboard capability. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public interface ClipboardCapable { 29 | 30 | /** 31 | * Returns mode for default clipboard actions like cut, copy, paste, delete. 32 | * 33 | * @return clipboard handling mode 34 | */ 35 | @Nonnull 36 | ClipboardHandlingMode getClipboardHandlingMode(); 37 | 38 | /** 39 | * Sets handle mode for default clipboard actions like cut, copy, paste, 40 | * delete. 41 | * 42 | * @param handlingMode clipboard handling mode 43 | */ 44 | void setClipboardHandlingMode(ClipboardHandlingMode handlingMode); 45 | } 46 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/capability/CodeCharactersCaseCapable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.capability; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.CodeCharactersCase; 21 | 22 | /** 23 | * Support for characters case capability. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public interface CodeCharactersCaseCapable { 29 | 30 | /** 31 | * Returns current code characters case. 32 | * 33 | * @return code characters case 34 | */ 35 | @Nonnull 36 | CodeCharactersCase getCodeCharactersCase(); 37 | 38 | /** 39 | * Sets current code characters case. 40 | * 41 | * @param codeCharactersCase code characters case 42 | */ 43 | void setCodeCharactersCase(CodeCharactersCase codeCharactersCase); 44 | } 45 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/capability/CodeTypeCapable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.capability; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.CodeType; 21 | 22 | /** 23 | * Support for code type capability. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public interface CodeTypeCapable { 29 | 30 | /** 31 | * Returns current code type. 32 | * 33 | * @return code type 34 | */ 35 | @Nonnull 36 | CodeType getCodeType(); 37 | 38 | /** 39 | * Sets current code type. 40 | * 41 | * @param codeType code type 42 | */ 43 | void setCodeType(CodeType codeType); 44 | } 45 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/capability/ViewModeCapable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.capability; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.basic.CodeAreaViewMode; 21 | 22 | /** 23 | * Support for view mode capability. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public interface ViewModeCapable { 29 | 30 | /** 31 | * Returns current view mode. 32 | * 33 | * @return view mode 34 | */ 35 | @Nonnull 36 | CodeAreaViewMode getViewMode(); 37 | 38 | /** 39 | * Sets current view mode. 40 | * 41 | * @param viewMode view mode 42 | */ 43 | void setViewMode(CodeAreaViewMode viewMode); 44 | } 45 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/color/BasicCodeAreaColorGroup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.color; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | 21 | /** 22 | * Enumeration of basic color groups. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | @ParametersAreNonnullByDefault 27 | public enum BasicCodeAreaColorGroup implements CodeAreaColorGroup { 28 | 29 | MAIN("main"), 30 | SELECTION("selection"); 31 | 32 | @Nonnull 33 | private final String groupId; 34 | 35 | BasicCodeAreaColorGroup(String groupId) { 36 | this.groupId = groupId; 37 | } 38 | 39 | @Nonnull 40 | @Override 41 | public String getId() { 42 | return groupId; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/color/BasicCodeAreaDecorationColorType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.color; 17 | 18 | import java.util.Optional; 19 | import javax.annotation.Nonnull; 20 | import javax.annotation.Nullable; 21 | import javax.annotation.ParametersAreNonnullByDefault; 22 | 23 | /** 24 | * Enumeration of decoration color types. 25 | * 26 | * @author ExBin Project (https://exbin.org) 27 | */ 28 | @ParametersAreNonnullByDefault 29 | public enum BasicCodeAreaDecorationColorType implements CodeAreaColorType { 30 | 31 | LINE("decoration.line", null); 32 | 33 | @Nonnull 34 | private final String typeId; 35 | @Nullable 36 | private final CodeAreaColorGroup group; 37 | 38 | BasicCodeAreaDecorationColorType(String typeId, @Nullable CodeAreaColorGroup group) { 39 | this.typeId = typeId; 40 | this.group = group; 41 | } 42 | 43 | @Nonnull 44 | @Override 45 | public String getId() { 46 | return typeId; 47 | } 48 | 49 | @Nonnull 50 | @Override 51 | public Optional getGroup() { 52 | return Optional.ofNullable(group); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/color/CodeAreaColorGroup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.color; 17 | 18 | import javax.annotation.Nonnull; 19 | 20 | /** 21 | * Interface for code area color group. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | public interface CodeAreaColorGroup { 26 | 27 | /** 28 | * Returns unique string identifier. 29 | *

30 | * Custom implementations should start with full package name to avoid 31 | * collisions. 32 | * 33 | * @return unique identification ID key 34 | */ 35 | @Nonnull 36 | String getId(); 37 | } 38 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/color/CodeAreaColorType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.color; 17 | 18 | import java.util.Optional; 19 | import javax.annotation.Nonnull; 20 | 21 | /** 22 | * Interface for code area color type. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | public interface CodeAreaColorType { 27 | 28 | /** 29 | * Returns unique string identifier. 30 | *

31 | * Custom implementations should start with full package name to avoid 32 | * collisions. 33 | * 34 | * @return unique identification ID key 35 | */ 36 | @Nonnull 37 | String getId(); 38 | 39 | /** 40 | * Returns group which this color belongs to or empty. 41 | * 42 | * @return group 43 | */ 44 | @Nonnull 45 | Optional getGroup(); 46 | } 47 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/BinaryDataAbstractCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation; 17 | 18 | import org.exbin.bined.operation.undo.BinaryDataUndoableCommand; 19 | 20 | /** 21 | * Abstract binary data command class. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | public abstract class BinaryDataAbstractCommand implements BinaryDataUndoableCommand { 26 | 27 | public BinaryDataAbstractCommand() { 28 | } 29 | 30 | /** 31 | * Default redo operation reexecutes command. 32 | */ 33 | @Override 34 | public void redo() { 35 | execute(); 36 | } 37 | 38 | /** 39 | * Default dispose method do nothing. 40 | */ 41 | @Override 42 | public void dispose() { 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/BinaryDataCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation; 17 | 18 | import javax.annotation.Nonnull; 19 | 20 | /** 21 | * Interface for code area command. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | public interface BinaryDataCommand { 26 | 27 | /** 28 | * Returns type of the command. 29 | * 30 | * @return command type 31 | */ 32 | @Nonnull 33 | BinaryDataCommandType getType(); 34 | 35 | /** 36 | * Performs operation on given document. 37 | */ 38 | void execute(); 39 | 40 | /** 41 | * Disposes command. 42 | */ 43 | void dispose(); 44 | } 45 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/BinaryDataCommandPhase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation; 17 | 18 | /** 19 | * Enumeration of command execution phases. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum BinaryDataCommandPhase { 24 | 25 | CREATED, 26 | EXECUTED, 27 | REVERTED 28 | } 29 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/BinaryDataCommandType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation; 17 | 18 | /** 19 | * Command type interface. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public interface BinaryDataCommandType { 24 | } 25 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/BinaryDataCompoundCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation; 17 | 18 | import java.util.Collection; 19 | import java.util.List; 20 | import javax.annotation.Nonnull; 21 | import javax.annotation.ParametersAreNonnullByDefault; 22 | 23 | /** 24 | * Interface for compound command. 25 | * 26 | * @author ExBin Project (https://exbin.org) 27 | */ 28 | @ParametersAreNonnullByDefault 29 | public interface BinaryDataCompoundCommand extends BinaryDataCommand { 30 | 31 | /** 32 | * Adds command to the list of commands. 33 | * 34 | * @param command appended command 35 | */ 36 | void addCommand(BinaryDataCommand command); 37 | 38 | /** 39 | * Adds list of commands to the list of commands. 40 | * 41 | * @param commands appended commands 42 | */ 43 | void addCommands(Collection commands); 44 | 45 | /** 46 | * Returns list of commands. 47 | * 48 | * @return list of commands 49 | */ 50 | @Nonnull 51 | List getCommands(); 52 | 53 | /** 54 | * Returns true if compound command is empty. 55 | * 56 | * @return true if command is empty 57 | */ 58 | boolean isEmpty(); 59 | } 60 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/BinaryDataCompoundOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation; 17 | 18 | import java.util.Collection; 19 | import java.util.List; 20 | import javax.annotation.Nonnull; 21 | import javax.annotation.ParametersAreNonnullByDefault; 22 | 23 | /** 24 | * Interface for compound operation. 25 | * 26 | * @author ExBin Project (https://exbin.org) 27 | */ 28 | @ParametersAreNonnullByDefault 29 | public interface BinaryDataCompoundOperation extends BinaryDataOperation { 30 | 31 | /** 32 | * Adds operation to the list of operations. 33 | * 34 | * @param operation appended operation 35 | */ 36 | void addOperation(BinaryDataOperation operation); 37 | 38 | /** 39 | * Adds list of operations to the list of operations. 40 | * 41 | * @param operations appended operations 42 | */ 43 | void addOperations(Collection operations); 44 | 45 | /** 46 | * Returns list of operations. 47 | * 48 | * @return list of operations 49 | */ 50 | @Nonnull 51 | List getOperations(); 52 | 53 | /** 54 | * Returns true if compound operation is empty. 55 | * 56 | * @return true if operation is empty 57 | */ 58 | boolean isEmpty(); 59 | } 60 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/BinaryDataModifiedState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation; 17 | 18 | /** 19 | * Interface for binary data modified state. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public interface BinaryDataModifiedState { 24 | 25 | /** 26 | * Returns whether undo operation is modified. 27 | * 28 | * @return true if modified 29 | */ 30 | boolean isModified(); 31 | } 32 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/BinaryDataOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation; 17 | 18 | import javax.annotation.Nonnull; 19 | 20 | /** 21 | * Interface for binary data operation. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | public interface BinaryDataOperation { 26 | 27 | /** 28 | * Returns type of the operation. 29 | * 30 | * @return operation type 31 | */ 32 | @Nonnull 33 | BinaryDataOperationType getType(); 34 | 35 | /** 36 | * Performs operation. 37 | */ 38 | void execute(); 39 | 40 | /** 41 | * Disposes of the operation's resources. 42 | */ 43 | void dispose(); 44 | } 45 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/BinaryDataOperationType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation; 17 | 18 | /** 19 | * Operation type interface. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public interface BinaryDataOperationType { 24 | } 25 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/undo/BinaryDataAppendableCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.undo; 17 | 18 | import javax.annotation.ParametersAreNonnullByDefault; 19 | import org.exbin.bined.operation.BinaryDataCommand; 20 | 21 | /** 22 | * Interface for appendable binary data command. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | @ParametersAreNonnullByDefault 27 | public interface BinaryDataAppendableCommand extends BinaryDataUndoableCommand { 28 | 29 | /** 30 | * Attempts to execute command as an append to existing command. 31 | * 32 | * @param command command 33 | * @return true if sucessfully appended 34 | */ 35 | boolean appendExecute(BinaryDataCommand command); 36 | } 37 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/undo/BinaryDataAppendableOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.undo; 17 | 18 | import javax.annotation.ParametersAreNonnullByDefault; 19 | import org.exbin.bined.operation.BinaryDataOperation; 20 | 21 | /** 22 | * Interface for appendable binary data operation. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | @ParametersAreNonnullByDefault 27 | public interface BinaryDataAppendableOperation { 28 | 29 | /** 30 | * Attempts to append an operation. 31 | * 32 | * @param operation operation 33 | * @return true if sucessfully appended 34 | */ 35 | boolean appendOperation(BinaryDataOperation operation); 36 | } 37 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/undo/BinaryDataAppendableUndoRedo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.undo; 17 | 18 | import javax.annotation.ParametersAreNonnullByDefault; 19 | import org.exbin.bined.operation.BinaryDataCommand; 20 | 21 | /** 22 | * Undoable command sequence with support for appendable commands. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | @ParametersAreNonnullByDefault 27 | public interface BinaryDataAppendableUndoRedo extends BinaryDataUndoRedo { 28 | 29 | /** 30 | * Attempts to execute command as an append to existing command. 31 | * 32 | * @param command command 33 | * @return true if successfully appended 34 | */ 35 | boolean appendExecute(BinaryDataCommand command); 36 | } 37 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/undo/BinaryDataUndoRedoChangeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.undo; 17 | 18 | /** 19 | * Binary data undo change listener. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public interface BinaryDataUndoRedoChangeListener { 24 | 25 | /** 26 | * Undo changed. 27 | */ 28 | void undoChanged(); 29 | } 30 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/undo/BinaryDataUndoRedoState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.undo; 17 | 18 | /** 19 | * Code area undo support handler. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public interface BinaryDataUndoRedoState { 24 | 25 | /** 26 | * Returns whether undo operation is available. 27 | * 28 | * @return true if undo possible 29 | */ 30 | boolean canUndo(); 31 | 32 | /** 33 | * Returns whether redo operation is available. 34 | * 35 | * @return true if redo possible 36 | */ 37 | boolean canRedo(); 38 | } 39 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/undo/BinaryDataUndoableCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.undo; 17 | 18 | import org.exbin.bined.operation.*; 19 | 20 | /** 21 | * Interface for code area command. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | public interface BinaryDataUndoableCommand extends BinaryDataCommand { 26 | 27 | /** 28 | * Performs redo on given document. 29 | */ 30 | void redo(); 31 | 32 | /** 33 | * Performs undo operation on given document. 34 | */ 35 | void undo(); 36 | } 37 | -------------------------------------------------------------------------------- /app/libsrc/org/exbin/bined/operation/undo/BinaryDataUndoableOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.undo; 17 | 18 | import javax.annotation.Nonnull; 19 | import org.exbin.bined.operation.BinaryDataOperation; 20 | 21 | /** 22 | * Interface for undoable binary data operation. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | public interface BinaryDataUndoableOperation extends BinaryDataOperation { 27 | 28 | /** 29 | * Performs operation on given document and returns undo operation. 30 | * 31 | * @return undo operation 32 | */ 33 | @Nonnull 34 | BinaryDataUndoableOperation executeWithUndo(); 35 | } 36 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | -keep class kotlinx.coroutines.CoroutineExceptionHandler 16 | -keep class kotlinx.coroutines.internal.MainDispatcherFactory 17 | 18 | -dontwarn java.awt.* 19 | -keep class com.sun.jna.* { *; } 20 | -keepclassmembers class * extends com.sun.jna.* { public *; } 21 | 22 | -keep class androidx.appcompat.view.menu.MenuBuilder { 23 | void setOptionalIconsVisible(boolean); 24 | } 25 | -keepclassmembernames class androidx.appcompat.view.menu.MenuBuilder { 26 | void setOptionalIconsVisible(boolean); 27 | } 28 | 29 | -keep class java.util.Optional { *; } 30 | 31 | # Uncomment this to preserve the line number information for 32 | # debugging stack traces. 33 | #-keepattributes SourceFile,LineNumberTable 34 | 35 | # If you keep the line number information, uncomment this to 36 | # hide the original source file name. 37 | #-renamesourcefileattribute SourceFile 38 | -dontobfuscate 39 | #-dontusemixedcaseclassnames 40 | #-dontpreverify 41 | #-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/* 42 | #-optimizationpasses 5 43 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/exbin/bined/android/basic/CodeAreaComponentTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.android.basic; 17 | 18 | import androidx.test.ext.junit.rules.ActivityScenarioRule; 19 | import androidx.test.ext.junit.runners.AndroidJUnit4; 20 | 21 | import org.exbin.bined.editor.android.MainActivity; 22 | import org.junit.Rule; 23 | import org.junit.runner.RunWith; 24 | 25 | /** 26 | * Tests for CodeArea component. 27 | * 28 | * @author ExBin Project (https://exbin.org) 29 | */ 30 | @RunWith(AndroidJUnit4.class) 31 | public class CodeAreaComponentTest { 32 | 33 | @Rule 34 | public ActivityScenarioRule rule = new ActivityScenarioRule<>(MainActivity.class); 35 | 36 | public CodeAreaComponentTest() { 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/exbin/bined/android/basic/CodeAreaDataTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.android.basic; 17 | 18 | import org.exbin.bined.CodeAreaTest; 19 | 20 | /** 21 | * Tests for CodeArea component. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | public class CodeAreaDataTest extends CodeAreaComponentTest { 26 | 27 | public CodeAreaDataTest() { 28 | } 29 | /* 30 | @Test 31 | public void testContentData() { 32 | CodeAreaCore codeArea = createCodeArea(); 33 | codeArea.setContentData(CodeAreaTest.getSampleData(CodeAreaTest.SAMPLE_ALLBYTES)); 34 | 35 | Assert.assertEquals(256, codeArea.getDataSize()); 36 | } */ 37 | } 38 | -------------------------------------------------------------------------------- /app/src/androidTest/java/org/exbin/bined/editor/android/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package org.exbin.bined.editor.android; 2 | 3 | import android.content.Context; 4 | //import android.support.test.InstrumentationRegistry; 5 | //import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | //@RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // // Context of the app under test. 22 | // Context appContext = InstrumentationRegistry.getTargetContext(); 23 | // 24 | // assertEquals("org.exbin.bined.editor.android", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/androidTest/resources/org/exbin/bined/resources/test/10bytes.dat: -------------------------------------------------------------------------------- 1 | ABCDEFGHIJ -------------------------------------------------------------------------------- /app/src/androidTest/resources/org/exbin/bined/resources/test/5bytes.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/androidTest/resources/org/exbin/bined/resources/test/5bytes.dat -------------------------------------------------------------------------------- /app/src/androidTest/resources/org/exbin/bined/resources/test/allbytes.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/androidTest/resources/org/exbin/bined/resources/test/allbytes.dat -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/android/CodeAreaAndroidControl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.android; 17 | 18 | import android.graphics.Canvas; 19 | 20 | import org.exbin.bined.basic.CodeAreaScrollPosition; 21 | 22 | import javax.annotation.ParametersAreNonnullByDefault; 23 | 24 | /** 25 | * Code area android control. 26 | * 27 | * @author ExBin Project (https://exbin.org) 28 | */ 29 | @ParametersAreNonnullByDefault 30 | public interface CodeAreaAndroidControl { 31 | 32 | /** 33 | * Paints the main component. 34 | */ 35 | void paintComponent(Canvas g); 36 | 37 | /** 38 | * Rebuilds colors after UIManager change. 39 | */ 40 | void resetColors(); 41 | 42 | /** 43 | * Resets painter state for new painting. 44 | */ 45 | void reset(); 46 | 47 | /** 48 | * Requests update of the component layout. 49 | *

50 | * Notifies code area, that change of parameters will affect layout and it 51 | * should be recomputed and updated if necessary. 52 | */ 53 | void updateLayout(); 54 | 55 | /** 56 | * Updates scroll position. 57 | * 58 | * @param scrollPosition scroll position 59 | */ 60 | void updateScrollPosition(CodeAreaScrollPosition scrollPosition); 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/android/CodeAreaPaintAssessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.android; 17 | 18 | import javax.annotation.ParametersAreNonnullByDefault; 19 | 20 | /** 21 | * Code area paint assessor. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | @ParametersAreNonnullByDefault 26 | public interface CodeAreaPaintAssessor { 27 | 28 | /** 29 | * Reports start of the paint operation. 30 | * 31 | * @param codeAreaPaintState paint state 32 | */ 33 | void startPaint(CodeAreaPaintState codeAreaPaintState); 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/android/CodeAreaPaintState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.android; 17 | 18 | import java.nio.charset.Charset; 19 | import javax.annotation.Nonnull; 20 | import javax.annotation.Nullable; 21 | import javax.annotation.ParametersAreNonnullByDefault; 22 | import org.exbin.auxiliary.binary_data.BinaryData; 23 | import org.exbin.bined.CodeAreaSection; 24 | import org.exbin.bined.CodeAreaSelection; 25 | import org.exbin.bined.android.basic.color.CodeAreaColorsProfile; 26 | 27 | /** 28 | * Code area paint state. 29 | * 30 | * @author ExBin Project (https://exbin.org) 31 | */ 32 | @ParametersAreNonnullByDefault 33 | public interface CodeAreaPaintState { 34 | 35 | @Nonnull 36 | CodeAreaSection getActiveSection(); 37 | 38 | @Nonnull 39 | CodeAreaColorsProfile getColorsProfile(); 40 | 41 | @Nonnull 42 | Charset getCharset(); 43 | 44 | @Nonnull 45 | byte[] getRowData(); 46 | 47 | int getMaxBytesPerChar(); 48 | 49 | int getCodeLastCharPos(); 50 | 51 | int getCharactersPerRow(); 52 | 53 | int getBytesPerRow(); 54 | 55 | long getDataSize(); 56 | 57 | // TODO: Replace with row data only? 58 | @Nonnull 59 | BinaryData getContentData(); 60 | 61 | @Nullable 62 | CodeAreaSelection getSelectionHandler(); 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/android/basic/color/BasicColorsCapableCodeAreaPainter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.android.basic.color; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | 21 | /** 22 | * Capability of painter to handle basic colors setting. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | @ParametersAreNonnullByDefault 27 | public interface BasicColorsCapableCodeAreaPainter { 28 | 29 | /** 30 | * Returns basic profile for colors. 31 | * 32 | * @return colors profile 33 | */ 34 | @Nonnull 35 | BasicCodeAreaColorsProfile getBasicColors(); 36 | 37 | /** 38 | * Sets basic profile for colors. 39 | * 40 | * @param colorsProfile colors profile 41 | */ 42 | void setBasicColors(BasicCodeAreaColorsProfile colorsProfile); 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/android/basic/color/CodeAreaColorsProfile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.android.basic.color; 17 | 18 | import org.exbin.bined.color.CodeAreaBasicColors; 19 | import org.exbin.bined.color.CodeAreaColorType; 20 | 21 | import javax.annotation.Nullable; 22 | import javax.annotation.ParametersAreNonnullByDefault; 23 | 24 | /** 25 | * Colors profile. 26 | * 27 | * @author ExBin Project (https://exbin.org) 28 | */ 29 | @ParametersAreNonnullByDefault 30 | public interface CodeAreaColorsProfile { 31 | 32 | /** 33 | * Returns color of the specified type. 34 | * 35 | * @param colorType color type 36 | * @return color or null if not defined 37 | */ 38 | @Nullable 39 | Integer getColor(CodeAreaColorType colorType); 40 | 41 | /** 42 | * Returns color of the specified type. 43 | * 44 | * @param colorType color type 45 | * @param basicAltColor basic color type used as fallback 46 | * @return color or null if not defined 47 | */ 48 | @Nullable 49 | Integer getColor(CodeAreaColorType colorType, @Nullable CodeAreaBasicColors basicAltColor); 50 | 51 | /** 52 | * Reinitialize colors. 53 | */ 54 | void reinitialize(); 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/android/capability/BasicColorsCapable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.android.capability; 17 | 18 | import java.util.Optional; 19 | import javax.annotation.Nonnull; 20 | import javax.annotation.ParametersAreNonnullByDefault; 21 | import org.exbin.bined.android.basic.color.BasicCodeAreaColorsProfile; 22 | 23 | /** 24 | * Support for basic set of colors. 25 | * 26 | * @author ExBin Project (https://exbin.org) 27 | */ 28 | @ParametersAreNonnullByDefault 29 | public interface BasicColorsCapable { 30 | 31 | /** 32 | * Returns basic profile for colors. 33 | * 34 | * @return colors profile 35 | */ 36 | @Nonnull 37 | Optional getBasicColors(); 38 | 39 | /** 40 | * Sets basic profile for colors. 41 | * 42 | * @param colorsProfile colors profile 43 | */ 44 | void setBasicColors(BasicCodeAreaColorsProfile colorsProfile); 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/android/capability/CharAssessorPainterCapable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.android.capability; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.android.CodeAreaCharAssessor; 21 | 22 | /** 23 | * Painter support for character assessor capability. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public interface CharAssessorPainterCapable { 29 | 30 | /** 31 | * Returns character assessor. 32 | * 33 | * @return character assessor 34 | */ 35 | @Nonnull 36 | CodeAreaCharAssessor getCharAssessor(); 37 | 38 | /** 39 | * Sets character assessor. 40 | * 41 | * @param charAssessor character assessor 42 | */ 43 | void setCharAssessor(CodeAreaCharAssessor charAssessor); 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/android/capability/ColorAssessorPainterCapable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.android.capability; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.android.CodeAreaColorAssessor; 21 | 22 | /** 23 | * Painter support for color assessor capability. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public interface ColorAssessorPainterCapable { 29 | 30 | /** 31 | * Returns color assessor. 32 | * 33 | * @return color assessor 34 | */ 35 | @Nonnull 36 | CodeAreaColorAssessor getColorAssessor(); 37 | 38 | /** 39 | * Sets color assessor. 40 | * 41 | * @param colorAssessor color assessor 42 | */ 43 | void setColorAssessor(CodeAreaColorAssessor colorAssessor); 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/android/capability/FontCapable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.android.capability; 17 | 18 | import org.exbin.bined.android.Font; 19 | 20 | import javax.annotation.Nonnull; 21 | import javax.annotation.ParametersAreNonnullByDefault; 22 | 23 | /** 24 | * Support for font capability. 25 | * 26 | * @author ExBin Project (https://exbin.org) 27 | */ 28 | @ParametersAreNonnullByDefault 29 | public interface FontCapable { 30 | 31 | /** 32 | * Returns font used for text painting. 33 | * 34 | * @return font 35 | */ 36 | @Nonnull 37 | Font getCodeFont(); 38 | 39 | /** 40 | * Sets font used for text painting. 41 | * 42 | * @param codeFont font 43 | */ 44 | void setCodeFont(Font codeFont); 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/editor/android/SinglePreferenceFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.editor.android; 17 | 18 | import android.os.Bundle; 19 | 20 | import androidx.annotation.Nullable; 21 | import androidx.preference.ListPreference; 22 | import androidx.preference.PreferenceFragmentCompat; 23 | 24 | public class SinglePreferenceFragment extends PreferenceFragmentCompat { 25 | 26 | private static final String DIALOG_FRAGMENT_TAG = "androidx.preference.PreferenceFragment.DIALOG"; 27 | 28 | @Override 29 | public void onCreatePreferences(@Nullable Bundle savedInstanceState, @Nullable String rootKey) { 30 | // setPreferencesFromResource(R.xml.view_preferences, "code_type"); 31 | 32 | ListPreference listPreference = new ListPreference(getContext(), null); 33 | listPreference.setEntries(getResources().getTextArray(R.array.code_type_values)); 34 | getPreferenceManager().showDialog(listPreference); 35 | } 36 | } -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/editor/android/options/DataInspectorMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.editor.android.options; 17 | 18 | import javax.annotation.ParametersAreNonnullByDefault; 19 | 20 | /** 21 | * Data inspector panel mode. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | @ParametersAreNonnullByDefault 26 | public enum DataInspectorMode { 27 | HIDE, 28 | SHOW, 29 | LANDSCAPE 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/editor/android/options/KeysPanelMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.editor.android.options; 17 | 18 | import javax.annotation.ParametersAreNonnullByDefault; 19 | 20 | /** 21 | * Keys panel mode. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | @ParametersAreNonnullByDefault 26 | public enum KeysPanelMode { 27 | HIDE, 28 | SMALL, 29 | MEDIUM, 30 | BIG 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/editor/android/options/MainOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.editor.android.options; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | 21 | /** 22 | * Application preferences. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | @ParametersAreNonnullByDefault 27 | public interface MainOptions { 28 | 29 | @Nonnull 30 | String getLocaleLanguage(); 31 | 32 | @Nonnull 33 | String getLocaleCountry(); 34 | 35 | @Nonnull 36 | String getLocaleVariant(); 37 | 38 | @Nonnull 39 | String getLocaleTag(); 40 | 41 | @Nonnull 42 | String getTheme(); 43 | 44 | void setLocaleLanguage(String language); 45 | 46 | void setLocaleCountry(String country); 47 | 48 | void setLocaleVariant(String variant); 49 | 50 | void setLocaleTag(String variant); 51 | 52 | void setTheme(String theme); 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/editor/android/options/StatusOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.editor.android.options; 17 | 18 | import org.exbin.framework.bined.StatusCursorPositionFormat; 19 | import org.exbin.framework.bined.StatusDocumentSizeFormat; 20 | 21 | import javax.annotation.Nonnull; 22 | import javax.annotation.ParametersAreNonnullByDefault; 23 | 24 | /** 25 | * Status panel options. 26 | * 27 | * @author ExBin Project (https://exbin.org) 28 | */ 29 | @ParametersAreNonnullByDefault 30 | public interface StatusOptions { 31 | 32 | @Nonnull 33 | StatusCursorPositionFormat getCursorPositionFormat(); 34 | 35 | int getDecimalSpaceGroupSize(); 36 | 37 | @Nonnull 38 | StatusDocumentSizeFormat getDocumentSizeFormat(); 39 | 40 | int getHexadecimalSpaceGroupSize(); 41 | 42 | int getOctalSpaceGroupSize(); 43 | 44 | void setCursorPositionFormat(StatusCursorPositionFormat cursorPositionFormat); 45 | 46 | void setDecimalSpaceGroupSize(int decimalSpaceGroupSize); 47 | 48 | void setDocumentSizeFormat(StatusDocumentSizeFormat documentSizeFormat); 49 | 50 | void setHexadecimalSpaceGroupSize(int hexadecimalSpaceGroupSize); 51 | 52 | void setOctalSpaceGroupSize(int octalSpaceGroupSize); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/editor/android/options/TextEncodingOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.editor.android.options; 17 | 18 | import java.util.List; 19 | 20 | import javax.annotation.Nonnull; 21 | import javax.annotation.ParametersAreNonnullByDefault; 22 | 23 | /** 24 | * Text encoding options. 25 | * 26 | * @author ExBin Project (https://exbin.org) 27 | */ 28 | @ParametersAreNonnullByDefault 29 | public interface TextEncodingOptions { 30 | 31 | @Nonnull 32 | List getEncodings(); 33 | 34 | @Nonnull 35 | String getSelectedEncoding(); 36 | 37 | void setEncodings(List encodings); 38 | 39 | @Nonnull 40 | void setSelectedEncoding(String selectedEncoding); 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/editor/android/options/TextFontOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.editor.android.options; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | 21 | /** 22 | * Text font options. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | @ParametersAreNonnullByDefault 27 | public interface TextFontOptions { 28 | 29 | int getFontSize(); 30 | 31 | void setFontSize(int size); 32 | /* 33 | @Nonnull 34 | Font getFont(Font initialFont); 35 | 36 | @Nullable 37 | Map getFontAttributes(); 38 | 39 | boolean isUseDefaultFont(); 40 | 41 | void setFontAttributes(@Nullable Map fontAttributes); 42 | 43 | void setUseDefaultFont(boolean useDefaultFont); */ 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/editor/android/options/Theme.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.editor.android.options; 17 | 18 | import javax.annotation.ParametersAreNonnullByDefault; 19 | 20 | /** 21 | * Themes. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | @ParametersAreNonnullByDefault 26 | public enum Theme { 27 | DEFAULT, 28 | LIGHT, 29 | DARK 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/highlight/android/SearchMatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.highlight.android; 17 | 18 | /** 19 | * Simple POJO class for search match. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public class SearchMatch { 24 | 25 | long position; 26 | long length; 27 | 28 | public SearchMatch() { 29 | } 30 | 31 | public SearchMatch(long position, long length) { 32 | this.position = position; 33 | this.length = length; 34 | } 35 | 36 | public long getPosition() { 37 | return position; 38 | } 39 | 40 | public void setPosition(long position) { 41 | this.position = position; 42 | } 43 | 44 | public long getLength() { 45 | return length; 46 | } 47 | 48 | public void setLength(long length) { 49 | this.length = length; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/highlight/android/color/ColorizationCodeAreaColorsGroup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.highlight.android.color; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.color.CodeAreaColorGroup; 21 | 22 | /** 23 | * Enumeration of color groups for code area colorization. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public enum ColorizationCodeAreaColorsGroup implements CodeAreaColorGroup { 29 | 30 | COLORIZATION("colorization"); 31 | 32 | @Nonnull 33 | private final String groupId; 34 | 35 | private ColorizationCodeAreaColorsGroup(String groupId) { 36 | this.groupId = groupId; 37 | } 38 | 39 | @Nonnull 40 | @Override 41 | public String getId() { 42 | return groupId; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/highlight/android/color/MatchCodeAreaColorsGroup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.highlight.android.color; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.color.CodeAreaColorGroup; 21 | 22 | /** 23 | * Enumeration of color groups for code area matching. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public enum MatchCodeAreaColorsGroup implements CodeAreaColorGroup { 29 | 30 | MATCHING("matching"); 31 | 32 | @Nonnull 33 | private final String groupId; 34 | 35 | private MatchCodeAreaColorsGroup(String groupId) { 36 | this.groupId = groupId; 37 | } 38 | 39 | @Nonnull 40 | @Override 41 | public String getId() { 42 | return groupId; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/highlight/android/color/NonprintableCodeAreaColorsGroup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.highlight.android.color; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.color.CodeAreaColorGroup; 21 | 22 | /** 23 | * Enumeration of color groups for nonprintable colors. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public enum NonprintableCodeAreaColorsGroup implements CodeAreaColorGroup { 29 | 30 | NONPRINTABLES("nonprintables"); 31 | 32 | @Nonnull 33 | private final String groupId; 34 | 35 | NonprintableCodeAreaColorsGroup(String groupId) { 36 | this.groupId = groupId; 37 | } 38 | 39 | @Nonnull 40 | @Override 41 | public String getId() { 42 | return groupId; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/operation/android/CharEditDataOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.android; 17 | 18 | import javax.annotation.ParametersAreNonnullByDefault; 19 | import org.exbin.bined.android.CodeAreaCore; 20 | 21 | /** 22 | * Abstract operation for editing data. 23 | * 24 | * @author ExBin Project (https://exbin.org) 25 | */ 26 | @ParametersAreNonnullByDefault 27 | public abstract class CharEditDataOperation extends CodeAreaOperation { 28 | 29 | public CharEditDataOperation(CodeAreaCore codeArea) { 30 | super(codeArea); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/operation/android/CodeAreaOperationType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.android; 17 | 18 | import org.exbin.bined.operation.BinaryDataOperationType; 19 | 20 | /** 21 | * Operation type enumeration. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | public enum CodeAreaOperationType implements BinaryDataOperationType { 26 | 27 | /** 28 | * Insert data operation. 29 | */ 30 | INSERT_DATA, 31 | /** 32 | * Remove data operation. 33 | */ 34 | REMOVE_DATA, 35 | /** 36 | * Modify data operation. 37 | */ 38 | MODIFY_DATA, 39 | /** 40 | * Move data operation. 41 | */ 42 | MOVE_DATA, 43 | /** 44 | * Edit data operation. 45 | */ 46 | EDIT_DATA, 47 | /** 48 | * Compound operation. 49 | */ 50 | COMPOUND; 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/operation/android/CodeEditDataOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.android; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.CodeType; 21 | import org.exbin.bined.android.CodeAreaCore; 22 | 23 | /** 24 | * Abstract operation for editing data. 25 | * 26 | * @author ExBin Project (https://exbin.org) 27 | */ 28 | @ParametersAreNonnullByDefault 29 | public abstract class CodeEditDataOperation extends CodeAreaOperation { 30 | 31 | public CodeEditDataOperation(CodeAreaCore coreArea) { 32 | super(coreArea); 33 | } 34 | 35 | /** 36 | * Code type used for this edit operation. 37 | * 38 | * @return code type 39 | */ 40 | @Nonnull 41 | public abstract CodeType getCodeType(); 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/operation/android/command/CodeAreaCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.android.command; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.operation.BinaryDataAbstractCommand; 21 | import org.exbin.bined.android.CodeAreaCore; 22 | 23 | /** 24 | * Abstract class for operation on code area component. 25 | * 26 | * @author ExBin Project (https://exbin.org) 27 | */ 28 | @ParametersAreNonnullByDefault 29 | public abstract class CodeAreaCommand extends BinaryDataAbstractCommand { 30 | 31 | @Nonnull 32 | protected final CodeAreaCore codeArea; 33 | 34 | public CodeAreaCommand(CodeAreaCore codeArea) { 35 | this.codeArea = codeArea; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/operation/android/command/CodeAreaCommandType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.android.command; 17 | 18 | import org.exbin.bined.operation.BinaryDataCommandType; 19 | 20 | /** 21 | * Operation type enumeration. 22 | * 23 | * @author ExBin Project (https://exbin.org) 24 | */ 25 | public enum CodeAreaCommandType implements BinaryDataCommandType { 26 | 27 | /** 28 | * Insert data command. 29 | */ 30 | DATA_INSERTED, 31 | /** 32 | * Remove data command. 33 | */ 34 | DATA_REMOVED, 35 | /** 36 | * Modify data command. 37 | */ 38 | DATA_MODIFIED, 39 | /** 40 | * Move data command. 41 | */ 42 | DATA_MOVED, 43 | /** 44 | * Compound command. 45 | */ 46 | COMPOUND, 47 | /** 48 | * Edit data command. 49 | */ 50 | DATA_EDITED; 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/operation/android/command/EditDataCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.android.command; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.android.CodeAreaCore; 21 | 22 | /** 23 | * Command for editing data in text mode. 24 | * 25 | * @author ExBin Project (https://exbin.org) 26 | */ 27 | @ParametersAreNonnullByDefault 28 | public abstract class EditDataCommand extends CodeAreaCommand { 29 | 30 | public EditDataCommand(CodeAreaCore codeArea) { 31 | super(codeArea); 32 | } 33 | 34 | @Nonnull 35 | @Override 36 | public CodeAreaCommandType getType() { 37 | return CodeAreaCommandType.DATA_EDITED; 38 | } 39 | 40 | @Nonnull 41 | public abstract EditOperationType getEditOperationType(); 42 | 43 | public enum EditOperationType { 44 | INSERT, OVERWRITE, DELETE 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/operation/android/command/ModifyDataCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.android.command; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.operation.android.ModifyDataOperation; 21 | import org.exbin.bined.android.CodeAreaCore; 22 | import org.exbin.auxiliary.binary_data.BinaryData; 23 | 24 | /** 25 | * Command for modifying data. 26 | * 27 | * @author ExBin Project (https://exbin.org) 28 | */ 29 | @ParametersAreNonnullByDefault 30 | public class ModifyDataCommand extends OpCodeAreaCommand { 31 | 32 | public ModifyDataCommand(CodeAreaCore codeArea, long position, BinaryData data) { 33 | super(codeArea); 34 | super.setOperation(new ModifyDataOperation(codeArea, position, data)); 35 | } 36 | 37 | @Nonnull 38 | @Override 39 | public CodeAreaCommandType getType() { 40 | return CodeAreaCommandType.DATA_MODIFIED; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/bined/operation/android/command/RemoveDataCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.bined.operation.android.command; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.ParametersAreNonnullByDefault; 20 | import org.exbin.bined.operation.android.RemoveDataOperation; 21 | import org.exbin.bined.android.CodeAreaCore; 22 | 23 | /** 24 | * Command for deleting data. 25 | * 26 | * @author ExBin Project (https://exbin.org) 27 | */ 28 | @ParametersAreNonnullByDefault 29 | public class RemoveDataCommand extends OpCodeAreaCommand { 30 | 31 | public RemoveDataCommand(CodeAreaCore codeArea, long position, int codeOffset, long size) { 32 | super(codeArea); 33 | super.setOperation(new RemoveDataOperation(codeArea, position, codeOffset, size)); 34 | } 35 | 36 | @Nonnull 37 | @Override 38 | public CodeAreaCommandType getType() { 39 | return CodeAreaCommandType.DATA_REMOVED; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/org/exbin/framework/bined/FileHandlingMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) ExBin Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.exbin.framework.bined; 17 | 18 | /** 19 | * File handling mode. 20 | * 21 | * @author ExBin Project (https://exbin.org) 22 | */ 23 | public enum FileHandlingMode { 24 | /** 25 | * Direct access to stream of externally handled file. 26 | */ 27 | DIRECT, 28 | /** 29 | * Whole file is loaded to memory. 30 | */ 31 | MEMORY, 32 | /** 33 | * File is handled using delta changes. 34 | */ 35 | DELTA; 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/res/color/menu_icon_state.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/main/res/drawable/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/main/res/drawable/banner.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_exit_24.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_eye_24.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_file_new_24.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_file_open_24.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_file_save_24.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_file_save_as_24.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_info_24.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_language_24.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_palette_24.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_redo_24.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search_24.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_settings_24.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_undo_24.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_file.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 17 | 18 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 20 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/settings_activity.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values-cs/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Výchozí (systém) 4 | Světlý 5 | Tmavý 6 | 7 | 8 | 9 | Vyplnit šířku 10 | 4 bajty 11 | 8 bajtů 12 | 12 bajtů 13 | 16 bajtů 14 | Vlastní 15 | 16 | 17 | 18 | Duální 19 | Matice kódů 20 | Náhled textu 21 | 22 | 23 | 24 | Binární 25 | Osmičková 26 | Desetinné 27 | Hexadecimální 28 | 29 | 30 | 31 | Malá písmena 32 | Velká písmena 33 | 34 | 35 | 36 | Načíst celý soubor 37 | Pouze změny 38 | 39 | 40 | 41 | Skrýt 42 | Malý 43 | Střední 44 | Velký 45 | 46 | 47 | 48 | Skrýt 49 | Zobrazit 50 | Při orientaci na šířku 51 | 52 | -------------------------------------------------------------------------------- /app/src/main/res/values-hi/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | स्क्रीन भरें 4 | 4 बाइट 5 | 8 बाइट 6 | 12 बाइट 7 | 16 बाइट 8 | पसंद के अनुसार 9 | 10 | 11 | 12 | द्वैतिक 13 | कोड मैट्रिक्स 14 | पाठ पूर्वावलोकन 15 | 16 | 17 | 18 | बाइनरी 19 | ऑक्टल 20 | दशमलव 21 | हैक्साडेसिमल 22 | 23 | 24 | 25 | निम्न वर्ण 26 | उच्च वर्ण 27 | 28 | 29 | 30 | पूरी फ़ाइल लोड करें 31 | केवल परिवर्तन 32 | 33 | 34 | 35 | छिपाना 36 | छोटा 37 | मध्यम 38 | बड़ा 39 | 40 | 41 | 42 | छिपाना 43 | दिखाओ 44 | लैंडस्केप ओरिएंटेशन में 45 | 46 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #1F2155 4 | #101F3F 5 | #FF4081 6 | #FFEFEFEF 7 | #FF6F6F6F 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/values-pt/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Automático (sistema) 4 | Claro 5 | Escuro 6 | 7 | 8 | 9 | Preencher Tela 10 | 4 Bytes 11 | 8 Bytes 12 | 12 Bytes 13 | 16 Bytes 14 | Personalizado 15 | 16 | 17 | 18 | Duplo 19 | Apenas Código 20 | Apenas Texto 21 | 22 | 23 | 24 | Binary 25 | Octal 26 | Decimal 27 | Hexadecimal 28 | 29 | 30 | 31 | Minúsculas 32 | Maiúsculas 33 | 34 | 35 | 36 | Carregar arquivo completo 37 | Apenas alterações 38 | 39 | 40 | 41 | Ocultar 42 | Pequeno 43 | Médio 44 | Grande 45 | 46 | 47 | 48 | Ocultar 49 | Mostrar 50 | Em Orientação Horizontal 51 | 52 | -------------------------------------------------------------------------------- /app/src/main/res/values-tr/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Otomatik (sistem) 4 | Açık 5 | Koyu 6 | 7 | 8 | 9 | Ekranı Doldur 10 | 4 Byte 11 | 8 Byte 12 | 12 Byte 13 | 16 Byte 14 | Özel 15 | 16 | 17 | 18 | Çift 19 | Kod Tablosu 20 | Metin Önizleme 21 | 22 | 23 | 24 | İkili 25 | Sekizli 26 | Onlu 27 | Onaltılı 28 | 29 | 30 | 31 | Küçük Harf 32 | Büyük Harf 33 | 34 | 35 | 36 | Tüm Dosyayı Yükle 37 | Sadece Değişiklikler 38 | 39 | 40 | 41 | Sakla 42 | Küçük 43 | Orta 44 | Büyük 45 | 46 | 47 | 48 | Sakla 49 | Göster 50 | Yatay modda 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /app/src/main/res/values-zh-rCN/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 跟随系统 4 | Light 5 | 暗色 6 | 7 | 8 | 9 | Fill Screen 10 | 4 Bytes 11 | 8 Bytes 12 | 12 Bytes 13 | 16 Bytes 14 | 自定义 15 | 16 | 17 | 18 | 双列 19 | 代码矩阵 20 | 文本预览 21 | 22 | 23 | 24 | 二进制 25 | 八进制 26 | 十进制 27 | 十六进制 28 | 29 | 30 | 31 | 小写 32 | 大写 33 | 34 | 35 | 36 | 加载整个文件 37 | 仅加载不同部分 38 | 39 | 40 | 41 | 隐藏 42 | 较小 43 | 适中 44 | 较大 45 | 46 | 47 | 48 | 隐藏 49 | 显示 50 | 置于底部 51 | 52 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #FF29B6F6 7 | #FF039BE5 8 | #FFBDBDBD 9 | #FF757575 10 | #FF202020 11 | #FF9F9F9F 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 16 | 17 | 24 | 25 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/xml/backup_rules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/xml/header_preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 12 | 13 | 20 | 21 | 28 | 29 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/xml/main_preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 20 | 21 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | plugins { 3 | id 'com.android.application' version '8.10.1' apply false 4 | id 'com.android.library' version '8.10.1' apply false 5 | } 6 | 7 | task clean(type: Delete) { 8 | delete rootProject.buildDir 9 | } 10 | -------------------------------------------------------------------------------- /changes.txt: -------------------------------------------------------------------------------- 1 | 0.2.7 2 | - Added Portuguese translation 3 | - Added Turkish translation 4 | - Bug fixes 5 | 6 | 0.2.6 (2025-05-29) 7 | - Added Chinese translation 8 | - Added crude charset table support 9 | - Bug fixes 10 | 11 | 0.2.5 (2025-05-07) 12 | - Double back key press exits app 13 | - Threaded search 14 | - Bug fixes 15 | 16 | 0.2.4 (2025-04-06) 17 | - Direct buffer allocation 18 | - Compatibility up to sdk14 19 | 20 | 0.2.3 (2024-11-13) 21 | - Added basic data inspector 22 | - Support for partial file opening 23 | - Support for D-Pad / Android TV 24 | - Options for button size in keys panel 25 | - Fix for button 9 (issue #13) 26 | 27 | 0.2.2 (2024-10-13) 28 | - Various bugfixes 29 | - Added Hindi translation 30 | - Added open with support 31 | - Show nonprintable characters 32 | - Show mirror cursor 33 | 34 | 0.2.1 (2024-09-27) 35 | - Basic support for selection / clipboard 36 | - Changed file dialog 37 | - Added settings and preferences 38 | - Added dark theme and language switching 39 | - Added menu icons 40 | 41 | 0.2.0.1 (2024-09-05) 42 | - Minor fix of keyboard support in preview 43 | 44 | 0.2.0 (2024-09-01) 45 | - First release 46 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/10.txt: -------------------------------------------------------------------------------- 1 | - Added basic data inspector 2 | - Support for partial file opening 3 | - Support for D-Pad / Android TV 4 | - Options for button size in keys panel 5 | - Fix for button 9 6 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/11.txt: -------------------------------------------------------------------------------- 1 | - Direct buffer allocation 2 | - Compatibility up to sdk14 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/13.txt: -------------------------------------------------------------------------------- 1 | - Double back key press exists app 2 | - Threaded search 3 | - Bug fixes 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/15.txt: -------------------------------------------------------------------------------- 1 | - Added Chinese translation 2 | - Added crude charset table support 3 | - Bug fixes 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/4.txt: -------------------------------------------------------------------------------- 1 | - Initial release 2 | - Limited functionality -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/5.txt: -------------------------------------------------------------------------------- 1 | - Basic support for selection / clipboard 2 | - Changed file dialog 3 | - Added settings and preferences 4 | - Added dark theme and language switching 5 | - Added menu icons 6 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/8.txt: -------------------------------------------------------------------------------- 1 | - Various bugfixes 2 | - Added Hindi translation 3 | - Added open with support 4 | - Show nonprintable characters 5 | - Show mirror cursor -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/full_description.txt: -------------------------------------------------------------------------------- 1 | BinEd is a hex editor tool, which allows to directly browse and edit content of any file or binary data. 2 | 3 | Features 4 | 5 | - Visualize data as numerical (hexadecimal) codes and text representation 6 | - Codes can be also binary, octal or decimal 7 | - Support for Unicode, UTF-8 and other charsets 8 | - Insert and overwrite edit modes 9 | - TODO: Searching for text / hexadecimal code with matching highlighting 10 | - Support for undo/redo 11 | - Support for files with size up to exabytes (in partial file mode) 12 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/fastlane/metadata/android/en-US/images/icon.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/sevenInchScreenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/fastlane/metadata/android/en-US/images/sevenInchScreenshots/1.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/tenInchScreenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/fastlane/metadata/android/en-US/images/tenInchScreenshots/1.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/tvScreenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/fastlane/metadata/android/en-US/images/tvScreenshots/1.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/short_description.txt: -------------------------------------------------------------------------------- 1 | Editor for binary data (hex viewer/editor) -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/title.txt: -------------------------------------------------------------------------------- 1 | BinEd - Hex Editor -------------------------------------------------------------------------------- /file_picker/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /file_picker/README.md: -------------------------------------------------------------------------------- 1 | # File Picker Dialogs 2 | 3 | Derived from from https://github.com/RustamG/file-dialogs/ 4 | 5 | ### MIT License 6 | 7 | ``` 8 | The MIT License (MIT) 9 | 10 | Copyright (c) 2015 Rustam Gilyaev 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files (the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions: 18 | 19 | The above copyright notice and this permission notice shall be included in 20 | all copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 28 | THE SOFTWARE. 29 | ``` 30 | -------------------------------------------------------------------------------- /file_picker/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | def playStore = false 4 | def materialVersion = '1.6.1' 5 | 6 | android { 7 | namespace = 'com.rustamg.filedialogs' 8 | compileSdk 34 9 | 10 | defaultConfig { 11 | if (playStore) { 12 | minSdk 24 13 | materialVersion = '1.12.0' 14 | } else { 15 | multiDexEnabled true 16 | minSdk 14 17 | } 18 | 19 | targetSdk 34 20 | } 21 | buildTypes { 22 | release { 23 | minifyEnabled false 24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 25 | } 26 | } 27 | compileOptions { 28 | // Flag to enable support for the new language APIs 29 | // coreLibraryDesugaringEnabled true 30 | 31 | // sourceCompatibility JavaVersion.VERSION_1_8 32 | // targetCompatibility JavaVersion.VERSION_1_8 33 | } 34 | lint { 35 | checkReleaseBuilds false 36 | } 37 | } 38 | 39 | tasks.withType(JavaCompile).configureEach { 40 | options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" 41 | } 42 | 43 | dependencies { 44 | implementation fileTree(include: ['*.jar'], dir: 'libs') 45 | compileOnly group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2' 46 | implementation "com.google.android.material:material:${materialVersion}" 47 | } 48 | -------------------------------------------------------------------------------- /file_picker/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /file_picker/src/main/java/com/rustamg/filedialogs/ExtensionFilter.java: -------------------------------------------------------------------------------- 1 | package com.rustamg.filedialogs; 2 | import java.io.File; 3 | import java.io.FileFilter; 4 | 5 | 6 | public class ExtensionFilter implements FileFilter { 7 | 8 | 9 | private final String mExtension; 10 | 11 | public ExtensionFilter(String extension) { 12 | 13 | extension = extension.toLowerCase().replaceAll("\\.", ""); 14 | 15 | if (!extension.isEmpty()) { 16 | extension = "." + extension; 17 | } 18 | 19 | mExtension = extension; 20 | } 21 | 22 | @Override 23 | public boolean accept(File file) { 24 | 25 | return file.isDirectory() || file.getName().toLowerCase().endsWith(mExtension); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /file_picker/src/main/java/com/rustamg/filedialogs/OpenFileDialog.java: -------------------------------------------------------------------------------- 1 | package com.rustamg.filedialogs; 2 | 3 | import java.io.File; 4 | 5 | public class OpenFileDialog extends FileDialog { 6 | 7 | 8 | @Override 9 | protected int getLayoutResourceId() { 10 | 11 | return R.layout.dialog_open_file; 12 | } 13 | 14 | @Override 15 | public void onFileSelected(File file) { 16 | 17 | if (file.isFile()) { 18 | sendResult(file); 19 | } else { 20 | super.onFileSelected(file); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /file_picker/src/main/java/com/rustamg/filedialogs/utils/KeyboardUtils.java: -------------------------------------------------------------------------------- 1 | package com.rustamg.filedialogs.utils; 2 | import android.app.Activity; 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.view.inputmethod.InputMethodManager; 6 | 7 | 8 | /** 9 | * Created at 17/02/15 18:22 10 | * 11 | * @author rustamg 12 | */ 13 | public class KeyboardUtils { 14 | 15 | public static void hideKeyboard(Activity activity) { 16 | 17 | InputMethodManager inputManager = (InputMethodManager) activity.getSystemService( 18 | Context.INPUT_METHOD_SERVICE); 19 | 20 | // check if no view has focus: 21 | View view = activity.getCurrentFocus(); 22 | if (view != null) { 23 | inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /file_picker/src/main/java/com/rustamg/filedialogs/utils/TextUtils.java: -------------------------------------------------------------------------------- 1 | package com.rustamg.filedialogs.utils; 2 | import java.util.ArrayList; 3 | import java.util.List; 4 | 5 | 6 | /** 7 | * Created at 17/02/15 18:10 8 | * 9 | * @author rustamg 10 | */ 11 | public class TextUtils { 12 | 13 | public static boolean isEmpty(String string) { 14 | 15 | return string == null || string.trim().length() == 0; 16 | } 17 | 18 | 19 | public static String getIntegersCommaSeparated(List array) { 20 | 21 | StringBuilder sb = new StringBuilder(); 22 | 23 | sb.append(array.get(0)); 24 | 25 | for (int i = 1; i < array.size(); i++) { 26 | sb.append(","); 27 | sb.append(array.get(i)); 28 | } 29 | 30 | return sb.toString(); 31 | } 32 | 33 | public static String getLongsCommaSeparated(List array) { 34 | 35 | StringBuilder sb = new StringBuilder(); 36 | 37 | sb.append(array.get(0)); 38 | 39 | for (int i = 1; i < array.size(); i++) { 40 | sb.append(","); 41 | sb.append(array.get(i)); 42 | } 43 | 44 | return sb.toString(); 45 | } 46 | 47 | public static List getLongs(String commaSeparatedString) { 48 | 49 | List longs = new ArrayList<>(); 50 | 51 | String[] strings = commaSeparatedString.split(","); 52 | 53 | for (String s : strings) { 54 | longs.add(Long.parseLong(s)); 55 | } 56 | 57 | return longs; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-hdpi/ic_action_accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-hdpi/ic_action_accept.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-hdpi/ic_cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-hdpi/ic_cross.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-hdpi/ic_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-hdpi/ic_file.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-hdpi/ic_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-hdpi/ic_folder.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-mdpi/ic_action_accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-mdpi/ic_action_accept.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-mdpi/ic_cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-mdpi/ic_cross.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-mdpi/ic_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-mdpi/ic_file.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-mdpi/ic_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-mdpi/ic_folder.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-xhdpi/ic_action_accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-xhdpi/ic_action_accept.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-xhdpi/ic_cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-xhdpi/ic_cross.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-xhdpi/ic_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-xhdpi/ic_file.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-xhdpi/ic_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-xhdpi/ic_folder.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-xxhdpi/ic_action_accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-xxhdpi/ic_action_accept.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-xxhdpi/ic_cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-xxhdpi/ic_cross.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-xxhdpi/ic_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-xxhdpi/ic_file.png -------------------------------------------------------------------------------- /file_picker/src/main/res/drawable-xxhdpi/ic_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/file_picker/src/main/res/drawable-xxhdpi/ic_folder.png -------------------------------------------------------------------------------- /file_picker/src/main/res/layout/dialog_open_file.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 17 | 18 | 21 | 22 | 30 | 31 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /file_picker/src/main/res/layout/list_item_file.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 15 | 16 | 21 | 22 | 29 | 30 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /file_picker/src/main/res/menu/dialog_save.xml: -------------------------------------------------------------------------------- 1 | 2 |

4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /file_picker/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /file_picker/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 8dp 6 | 56dp 7 | 8 | -------------------------------------------------------------------------------- /file_picker/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | File Picker 3 | 4 | Enter file name 5 | 6 | Invalid file name 7 | This field is required 8 | 9 | Save 10 | Overwrite the file? 11 | Overwrite 12 | Cancel 13 | 14 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Enables namespacing of each library's R class so that its R class includes only the 19 | # resources declared in the library itself and none from the library's dependencies, 20 | # thereby reducing the size of the R class for that library 21 | android.nonTransitiveRClass=true 22 | android.enableJetifier=false 23 | android.nonFinalResIds=true 24 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionSha256Sum=f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip 5 | networkTimeout=10000 6 | validateDistributionUrl=true 7 | zipStoreBase=GRADLE_USER_HOME 8 | zipStorePath=wrapper/dists 9 | -------------------------------------------------------------------------------- /images/editor_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exbin/bined-android/4e3872519a604cb4853d7d3e550dcbc638fbbc76/images/editor_screenshot.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | gradlePluginPortal() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | } 15 | rootProject.name = "BinEd" 16 | include ':app', ':file_picker' 17 | --------------------------------------------------------------------------------