Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gtk main router #2

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
alire/

# If Object_Dir_Scheme_Type is ".", objects end up in the source directory.
# Rather don't do that, but if you do, we should ignore the files
sources/*.ali
sources/*.o
sources/*.stderr
sources/*.stdout
100 changes: 98 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,102 @@

[![Alire](https://img.shields.io/endpoint?url=https://alire.ada.dev/badges/aicwl.json)](https://alire.ada.dev/crates/aicwl.html)

Mirror of Dmitry A. Kazakov's [Ada Industrial Control Widget Library](http://www.dmitry-kazakov.de/ada/aicwl.htm)
### Foreword

### [CHANGELOG](http://www.dmitry-kazakov.de/ada/aicwl.htm#changes_log)
This is, in essence, a mirror of Dmitry A. Kazakov's
[Ada Industrial Control Widget Library](http://www.dmitry-kazakov.de/ada/aicwl.htm).

I am not the developer of this library. This repository serves as a mirror of the
original releases of AICWL to ease integration with
[Alire](https://github.com/alire-project/alire).

For documentation refer to the [AICWL website](http://www.dmitry-kazakov.de/ada/aicwl.htm).

Dmitry also already provides pre-packaged binary and source archives for most supported
platforms, if that is all you need, you can download and install these and ignore this
repository.

## Introduction

AICWL is a library for designing high-quality industrial control
widgets for Ada applications. The software is based on
[GtkAda](https://docs.adacore.com/live/wave/gtkada/html/gtkada_rm/index.html),
Ada bindings to [Gtk+](https://www.gtk.org/), and
[cairo](https://www.cairographics.org/manual/index.html).

The key features of the library are:

* Widgets composed of transparent layers drawn by cairo
* Fully scalable graphics
* Support of time controlled refresh policy for real-time and heavy-duty applications
* Caching graphical operations
* Stream I/O support for serialization and deserialization
* Ready-to-use gauge, meter, oscilloscope widgets
* Editor widget for WYSIWYG design of complex dashboards

For further information, visit the
[AICWL website](http://www.dmitry-kazakov.de/ada/aicwl.htm).

### Changelog

Refer to the original software's
[Change log](http://www.dmitry-kazakov.de/ada/aicwl.htm#changes_log).

## Maintainer's note

The Alire crate is packaged rather minimalistic to keep dependencies on
external libraries at a minimum. The crate covers the core functionality of AICWL,
though, so it should be sufficient for most needs.

For example, the original distribution has references to
[Simple Components](http://www.dmitry-kazakov.de/ada/components.htm) which are
not strictly necessary for the core functionality of the library.

Maybe I'll package them one day and add them as dependency to the Alire crate.

Also disabled is the source view widget, which seems to require
libgtksourceview-2, another external dependency. Again, not strictly necessary
to cover the core functionality.

### Rules and Conventions

* The first (and only) rule is that I will not change the original sources (i.e.
the subdirectory named `sources` which contains everything provided by the
software's author. Sources are provided as is.
* I may deviate from that rule if the need arises, but this will then be
clearly stated in the release notes, and will likely require extra-ordinary
circumstances.
* Version numbers and associated tage follow those of the original author
* For tagging and the creation of Alire creates, I do add a patch level,
though.
Example:
AICWL3.24.0 denotes the (unchanged) AICWL3.24 release. If the patch level
increases that means I repackaged the software, updated the alire manifest
or otherwise improved upon the release.

### Repository Structure

Whenever a new version is released by the author, I will integrate this version
as is on the `main` in the `sources` directory branch and tag this import as
such (i.e. the latest tag is `aicwl3.24`).

Released crates will branch from the initial tag under a branch names
`releases/version-number` (e.g. `releases/3.24`). Whenever I package a new
version for Alire to be integrated with the Alire index this will happen
under this branch. The released version will be tagged as
rel-version-number-patchlevel (e.g. `rel-3.24-0`).

That means, contrary to most github projects the latest (packaged) version is
not on the `main` branch, but under the appropriate `releases` branch, the
latest copy of the software-as-is remains on the top of the main branch, though.

Considering that the main purpose of this repository is to provide Alire crates,
this shouldn't concern you, if you use Alire, your interaction with this
repository itself should be rather limited.

### Releases

Currently the only and newest release is AICWL 3.24, for obvious reasons I
started the integration from there. For historical purposed most AICWL releases
can be found in the repository, down to version AICWL 3.9, but they are not
packaged for Alire and I doubt they ever will.
12 changes: 12 additions & 0 deletions alire.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# THIS IS A MACHINE-GENERATED FILE. DO NOT EDIT MANUALLY.

[solution]
[solution.context]
solved = true
[[solution.state]]
crate = "gtkada"
fulfilment = "hinted"
pinned = false
transitivity = "direct"
versions = ">=17"

163 changes: 163 additions & 0 deletions alire.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
description = "Ada Industrial Control Widgets Library"
long-description = """
This crate provides a library for designing high-quality industrial control
widgets for Ada applications. The software is based on
[GtkAda](https://docs.adacore.com/live/wave/gtkada/html/gtkada_rm/index.html),
Ada bindings to [Gtk+](https://www.gtk.org/), and
[cairo](https://www.cairographics.org/manual/index.html).

The key features of the library are:

* Widgets composed of transparent layers drawn by cairo
* Fully scalable graphics
* Support of time controlled refresh policy for real-time and heavy-duty applications
* Caching graphical operations
* Stream I/O support for serialization and deserialization
* Ready-to-use gauge, meter, oscilloscope widgets
* Editor widget for WYSIWYG design of complex dashboards

For further information, visit the
[AICWL website](http://www.dmitry-kazakov.de/ada/aicwl.htm).

Maintainer's note:

This Alire crate is packaged in a rather minimalistic way to keep dependencies
on external libraries at a minimum. The crate covers the core functionality of
AICWL, though, so it should be sufficient for most needs.

For example, the original distribution has references to
[Simple Components](http://www.dmitry-kazakov.de/ada/components.htm) which are
not strictly necessary for the core functionality of the library.

Also disabled is the source view widget, which seems to require
libgtksourceview-2, another external dependency. Again, not strictly necessary
to cover the core functionality.
"""
name = "aicwl"
version = "3.24.1"
authors = ["Dmitry A. Kazakov <[email protected]>"]
website = "http://www.dmitry-kazakov.de/ada/aicwl.htm"
licenses = ["GMGPL 2.0", # according to website (http://www.dmitry-kazakov.de/ada/aicwl.htm)
"LGPL 3.0"] # according to sourceforge (https://sf.net/projects/aicwl)
maintainers = ["Vinzent \"Jellix\" Saranen <[email protected]>"]
maintainers-logins = ["Jellix"]
notes = "Due to missing libraries on the test machines, most executables are not currently built."
project-files = ["sources/aicwl.gpr",
"sources/aicwl-editor.gpr",
# Next three extend simple components
# (http://www.dmitry-kazakov.de/ada/components.htm), which is not
# included here.
# "components-gnade-gtk.gpr", # Needs components
# "components-gtk.gpr", # Needs components
# "components-odbc-gtk.gpr", # Needs components
# "sources/examples/on_line_plotter/on_line_plotter.gpr", # Needs rsvg-2
# "sources/examples/plotter/oscilloscope_plotter.gpr", # Needs rsvg-2
# "sources/test_aicwl/aicwl-tests.gpr", # Needs rsvg-2
# "sources/test_aicwl/test_oscilloscope.gpr", # Needs rsvg-2
# "sources/test_aicwl/test_oscilloscope_stack.gpr", # Needs rsvg-2
# Part of simple components, see above
# "sources/test_gtkada/components-gnade-gtk-tests.gpr", # Needs components
# "sources/test_gtkada/components-gtk-tests.gpr", # Needs components
# "sources/test_gtkada/gtkada_contributions-rsvg-tests.gpr", # Needs rsvg-2
# Disabled for now, this requires libgtksourceview-3.0 and
# my attempts resulted in some undefined symbol references
# to libgtk3
# "sources/test_gtkada/gtkada_contributions-source_view-tests.gpr",
# "sources/test_gtkada/gtkada_contributions-tests.gpr", # Needs rsvg-2
"sources/test_strings_edit/strings_edit-test.gpr"
# Requires components/xpm/xpm_parser
# "sources/xpm2gtkada/xpm2gtkada.gpr"
]

executables = [# examples/on_line_plotter/on_line_plotter.gpr
# "on_line_plotter",
# examples/plotter/oscilloscope_plotter.gpr
# "oscilloscope_plotter",
# test_aicwl/aicwl-tests.gpr
# "test_aicwl",
# test_aicwl/test_oscilloscope.gpr
# "test_oscilloscope",
# test_aicwl/test_oscilloscope_stack.gpr
# "test_oscilloscope_stack",
# test_gtkada/components-gnade-gtk-tests.gpr
# "test_gtk_persistent_directory_browser",
# test_gtkada/components-gtk-tests.gpr
# "test_gtk_directory_browser",
# test_gtkada/gtkada_contributions-rsvg-tests.gpr
# "test_gtk_rsvg",
# test_gtkada/gtkada_contributions-source_view-tests.gpr
# "test_gtk_source_view",
# test_gtkada/gtkada_contributions-tests.gpr
# "test_gtk_asynchronous_spawn",
# "test_gtk_button",
# "test_gtk_color",
# "test_gtk_columned_store",
# "test_gtk_controlled_string_list",
# "test_gtk_content_type",
# "test_gtk_custom_store",
# "test_gtk_enum_combo_box",
# "test_gtk_extension_store",
# "test_gtk_missed",
# "test_gtk_fixed",
# "test_gtk_recent_manager",
# "test_gtk_spawn",
# "test_gtk_tasking",
# "test_gtk_tracing",
# test_strings_edit/strings_edit-test.gpr
"strings_edit-utf8-categorization_generator",
"strings_edit-utf8-mapping_generator",
"test_base64",
"test_chacha20",
"test_iso_8601",
"test_iso_8859_2",
"test_iso_8859_3",
"test_iso_8859_4",
"test_iso_8859_5",
"test_iso_8859_6",
"test_iso_8859_7",
"test_iso_8859_8",
"test_iso_8859_9",
"test_iso_8859_10",
"test_itu_t61",
"test_koi8",
"test_macos_roman",
"test_oid",
"test_radix50",
"test_strings_edit",
"test_string_streams",
"test_windows_1250",
"test_windows_1251",
"test_windows_1252",
"test_windows_1253",
"test_windows_1254",
"test_windows_1255",
"test_windows_1256",
"test_windows_1257",
"test_windows_1258"
# xpm2gtkada/xpm2gtkada.gpr
#"xpm2gtkada"
]

tags = ["widgets", "gauge", "graphics", "ui", "gtk"]

[gpr-externals]
Legacy = ["Ada95", "Ada2005", "Ada2012"] # defaults to "Ada2012"
Development = ["Debug", "Release", "Profile"] # defaults to "Debug"

# Target_OS = ["Windows", "Windows_NT", "Linux", "UNIX", "OSX", "FreeBSD", "auto"]
# arch = ["x86_64", "i686", "armhf", "aarch64", "auto"]
#
# Note: Arch and Target_OS are determined automatically from Project'Target, so
# no need to have them set explicitely.
#
# Object_Dir = [".", "nested"]
#
# Note: Object_Dir works as follows: If it's ".", it will remain so, if it's
# "nested", Object_Dir will become roughly obj/{OS}/{arch}/{Development},
# e.g. "obj/linux/x86_64/debug", all other cases result in Object_Dir
# being unchanged.
# Hence we should leave it as is (the default is "."), trusting Alire to
# set an appropriate one.

[[depends-on]]
gtkada = ">=17"
5 changes: 3 additions & 2 deletions sources/gtk-main-router.adb
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ package body Gtk.Main.Router is
Menu : Gtk_Menu;
Item : Gtk_Image_Menu_Item;
Icon : Gtk_Image;
Start : Gtk_Text_Iter;
Start : aliased Gtk_Text_Iter;
Stop : Gtk_Text_Iter;
Can_Go : Boolean := Standard.False;
begin
Expand Down Expand Up @@ -1001,6 +1001,7 @@ package body Gtk.Main.Router is
Buffer_X : GInt;
Buffer_Y : GInt;
Moved : Boolean;
Res : Boolean;
begin
Dialog.Window_To_Buffer_Coords
( Text_Window_Widget,
Expand All @@ -1009,7 +1010,7 @@ package body Gtk.Main.Router is
Buffer_X,
Buffer_Y
);
Dialog.Get_Iter_At_Location (Start, Buffer_X, Buffer_Y);
Res := Dialog.Get_Iter_At_Location (Start'Access, Buffer_X, Buffer_Y);
Copy (Start, Stop);
Moved := Standard.True;
while Moved and then not Starts_Line (Start) loop
Expand Down