<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sciteco/src/interface-gtk, branch v2.0.0</title>
<subtitle>Scintilla-based Text Editor and COrrector</subtitle>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/'/>
<entry>
<title>the SciTECO data installation path is now configurable via --with-scitecodatadir</title>
<updated>2023-06-19T17:45:16+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2023-06-19T17:45:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=60a09132b62c3cae86f5e832830a4490ba5bf712'/>
<id>60a09132b62c3cae86f5e832830a4490ba5bf712</id>
<content type='text'>
* This is also the base of $SCITECOPATH.
* Changing it is useful for packaging where it is not possible to factor out the common
  files between Curses and Gtk builds into a "sciteco-common" package.
  As an alternative, you can now create disjunct sciteco-curses and sciteco-gtk packages.
* You will most likely want to use this for Gtk builds as in:
  --with-interface=gtk --program-prefix=g --with-scitecodatadir=/usr/local/share/gsciteco.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* This is also the base of $SCITECOPATH.
* Changing it is useful for packaging where it is not possible to factor out the common
  files between Curses and Gtk builds into a "sciteco-common" package.
  As an alternative, you can now create disjunct sciteco-curses and sciteco-gtk packages.
* You will most likely want to use this for Gtk builds as in:
  --with-interface=gtk --program-prefix=g --with-scitecodatadir=/usr/local/share/gsciteco.
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed caret scrolling on startup</title>
<updated>2023-06-18T15:50:39+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2023-06-18T15:50:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=493504f12f79990dae7791efa27366b560151f2c'/>
<id>493504f12f79990dae7791efa27366b560151f2c</id>
<content type='text'>
* Since Scintilla no longer automatically scrolls the caret (see 941f48da6dde691a7800290cc729aaaacd051392),
  the caret wouldn't always end up in the view on startup.
* Added teco_interface_refresh() which includes SCI_SCROLLCARET and
  is invoked on startup. This helps with the Curses backend.
  It also reduces code redundancies.
* On Gtk, the caret cannot be easily scrolled on startup as long as no size is allocated
  to the window, so we also added a size-allocate callback to the
  window's event box. Sizes are less often allocated to the event box than to the
  window itself for some strange reason.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Since Scintilla no longer automatically scrolls the caret (see 941f48da6dde691a7800290cc729aaaacd051392),
  the caret wouldn't always end up in the view on startup.
* Added teco_interface_refresh() which includes SCI_SCROLLCARET and
  is invoked on startup. This helps with the Curses backend.
  It also reduces code redundancies.
* On Gtk, the caret cannot be easily scrolled on startup as long as no size is allocated
  to the window, so we also added a size-allocate callback to the
  window's event box. Sizes are less often allocated to the event box than to the
  window itself for some strange reason.
</pre>
</div>
</content>
</entry>
<entry>
<title>resolved warning in gtk-label.c due to wrong enum type</title>
<updated>2023-05-14T11:37:09+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2023-05-14T11:37:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=517ae85027f088615026fad6b880647dac5abf0a'/>
<id>517ae85027f088615026fad6b880647dac5abf0a</id>
<content type='text'>
* This probably did not cause any bugs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* This probably did not cause any bugs.
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed CTRL+C interruptions on Windows; optimized CTRL+C polling on Gtk+</title>
<updated>2023-05-09T17:08:32+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2023-05-09T17:08:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=f557af9a9112955d3b65f6ad0d54c0791189f961'/>
<id>f557af9a9112955d3b65f6ad0d54c0791189f961</id>
<content type='text'>
* teco_interrupt() turned out to be unsuitable to kill child processes (eg. when &lt;EB&gt; hangs).
  Instead, we have Win32-specific code now.
* Since SIGINT can be ignored on UNIX, pressing CTRL+C was not guaranteed to kill the
  child process (eg. when &lt;EB&gt; hangs).
  At the same time, it makes sense to send SIGINT first, so programs can terminate gracefully.
  The behaviour has therefore been adapted: Interrupting with CTRL+C the first time will kill
  gracefully. The second time, a more agressive signal is sent to kill the child process.
  Unfortunately, this would be relatively tricky and complicated to do on Windows, so CTRL+C will always
  "hard-kill" the child process.
* Moreover, teco_interrupt() killed the entire process on Windows when called the second time.
  This resulted in any interruption to terminate SciTECO unexpectedly when tried the second time on Gtk/Win32.
* teco_sigint_occurred renamed to teco_interrupted:
  There may be several different sources for setting this flag.
* Checking for CTRL+C on Gtk involves driving the main event loop repeatedly.
  This is a very expensive operation. We now do that only every 100ms. This is still sufficient since
  keyboard input comes from humans.
  This optimization saves 75% runtime on Windows and 90% on Linux.
  * The same optimization turned out to be contraproductive on PDCurses/WinGUI.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* teco_interrupt() turned out to be unsuitable to kill child processes (eg. when &lt;EB&gt; hangs).
  Instead, we have Win32-specific code now.
* Since SIGINT can be ignored on UNIX, pressing CTRL+C was not guaranteed to kill the
  child process (eg. when &lt;EB&gt; hangs).
  At the same time, it makes sense to send SIGINT first, so programs can terminate gracefully.
  The behaviour has therefore been adapted: Interrupting with CTRL+C the first time will kill
  gracefully. The second time, a more agressive signal is sent to kill the child process.
  Unfortunately, this would be relatively tricky and complicated to do on Windows, so CTRL+C will always
  "hard-kill" the child process.
* Moreover, teco_interrupt() killed the entire process on Windows when called the second time.
  This resulted in any interruption to terminate SciTECO unexpectedly when tried the second time on Gtk/Win32.
* teco_sigint_occurred renamed to teco_interrupted:
  There may be several different sources for setting this flag.
* Checking for CTRL+C on Gtk involves driving the main event loop repeatedly.
  This is a very expensive operation. We now do that only every 100ms. This is still sufficient since
  keyboard input comes from humans.
  This optimization saves 75% runtime on Windows and 90% on Linux.
  * The same optimization turned out to be contraproductive on PDCurses/WinGUI.
</pre>
</div>
</content>
</entry>
<entry>
<title>Gtk: fixed scrolling in the command line widget</title>
<updated>2023-04-26T22:51:51+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2023-04-22T23:15:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=417ee008981c9aabc04fb574c63f3d90e232986c'/>
<id>417ee008981c9aabc04fb574c63f3d90e232986c</id>
<content type='text'>
* The caret wasn't always kept out of the UZ and at some point would totally leave the view.
  This was apparently cause by executing two SCI_SCROLLCARETs per teco_interface_cmdline_update().
* Instead, we now use a CARET_EVEN scroll policy which also works sufficiently well.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* The caret wasn't always kept out of the UZ and at some point would totally leave the view.
  This was apparently cause by executing two SCI_SCROLLCARETs per teco_interface_cmdline_update().
* Instead, we now use a CARET_EVEN scroll policy which also works sufficiently well.
</pre>
</div>
</content>
</entry>
<entry>
<title>Gtk: fixed entering dead keys</title>
<updated>2023-04-26T22:51:51+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2023-04-22T22:50:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=4c79d26a15385af046a18b05b7068e5878faf93c'/>
<id>4c79d26a15385af046a18b05b7068e5878faf93c</id>
<content type='text'>
* This is using an Input Method now.
* Entering dead keys has probably always been broken in Gtk which I only did not notice
  because I use a keyboard layout without dead keys.
  This affects the ^ and ` keys on a German layout.
* Once we support Unicode input, it would make sense to abuse Scintilla's already existing input method support.
  Unfortunately, forwarding keyboard events to the Scintilla view breaks event freezing and results in flickering.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* This is using an Input Method now.
* Entering dead keys has probably always been broken in Gtk which I only did not notice
  because I use a keyboard layout without dead keys.
  This affects the ^ and ` keys on a German layout.
* Once we support Unicode input, it would make sense to abuse Scintilla's already existing input method support.
  Unfortunately, forwarding keyboard events to the Scintilla view breaks event freezing and results in flickering.
</pre>
</div>
</content>
</entry>
<entry>
<title>fixup: reverted the last Scintilla patch and unref Scintilla objects via g_object_unref()</title>
<updated>2023-04-19T10:18:16+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2023-04-19T10:18:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=54850d4c762f1c44f2dad34b0d01b33a4d881e7f'/>
<id>54850d4c762f1c44f2dad34b0d01b33a4d881e7f</id>
<content type='text'>
* Turns out that using gtk_widget_destroy(), the finalize handler never gets called!?
  This means we were leaking memory.
* Using g_object_unref() fixes that and the initial Scintilla patch is no longer necessary.
* There have previously been use-after-free bugs when *not* using gtk_widget_destroy().
  This has apparently been fixed in the meantime in Scintilla.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Turns out that using gtk_widget_destroy(), the finalize handler never gets called!?
  This means we were leaking memory.
* Using g_object_unref() fixes that and the initial Scintilla patch is no longer necessary.
* There have previously been use-after-free bugs when *not* using gtk_widget_destroy().
  This has apparently been fixed in the meantime in Scintilla.
</pre>
</div>
</content>
</entry>
<entry>
<title>no longer try to avoid automatic scrolling - this is patched out of Scintilla now</title>
<updated>2023-04-18T09:11:55+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2023-04-18T09:11:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=941f48da6dde691a7800290cc729aaaacd051392'/>
<id>941f48da6dde691a7800290cc729aaaacd051392</id>
<content type='text'>
* The patch avoids all automatic scrolling consistently, including in SCI_UNDO.
  This speads up Undo (especially after interruptions).
* Also, the patch disables a very costly and pointless (in SciTECO) algorithm that
  effectively made &lt;Ix$&gt; uninterruptible.
* Effectively reverts large parts of 8ef010da59743fcc4927c790f585ba414ec7b129.
  I have never liked using unintuitive Scintilla messages to avoid scrolling.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* The patch avoids all automatic scrolling consistently, including in SCI_UNDO.
  This speads up Undo (especially after interruptions).
* Also, the patch disables a very costly and pointless (in SciTECO) algorithm that
  effectively made &lt;Ix$&gt; uninterruptible.
* Effectively reverts large parts of 8ef010da59743fcc4927c790f585ba414ec7b129.
  I have never liked using unintuitive Scintilla messages to avoid scrolling.
</pre>
</div>
</content>
</entry>
<entry>
<title>updated copyright to 2023</title>
<updated>2023-04-05T15:11:32+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2023-04-05T15:11:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=0f7424e9b041646d782fb4c8b2f81a2f74856731'/>
<id>0f7424e9b041646d782fb4c8b2f81a2f74856731</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed a number of crashes due to empty string arguments or uninitialized registers</title>
<updated>2022-11-28T03:05:48+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2022-11-28T03:05:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=9a20db4b5257d56d2d6030a20ad42f5e0dc9f25b'/>
<id>9a20db4b5257d56d2d6030a20ad42f5e0dc9f25b</id>
<content type='text'>
* An empty but valid teco_string_t can contain NULL pointers.
  More precisely, a state's done_cb() can be invoked with such empty strings
  in case of empty string arguments.
  Also a registers get_string() can return the NULL pointer
  for existing registers with uninitialized string parts.
* In all of these cases, the language should treat "uninitialized" strings
  exactly like empty strings.
* Not doing so, resulted in a number of vulnerabilities.
  * EN$$ crashed if "_" was uninitialized
  * The ^E@q and ^ENq string building constructs would crash for existing but
    uninitialized registers q.
  * ?$ would crash
  * ESSETILEXER$$ would crash
* This is now fixed.
  Test cases have been added.
* I cannot guarantee that I have found all such cases.
  Generally, it might be wise to change our definitions and make sure that
  every teco_string_t must have an associated heap object to be valid.
  All functions returning pointer+length pairs should consequently also never
  return NULL pointers.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* An empty but valid teco_string_t can contain NULL pointers.
  More precisely, a state's done_cb() can be invoked with such empty strings
  in case of empty string arguments.
  Also a registers get_string() can return the NULL pointer
  for existing registers with uninitialized string parts.
* In all of these cases, the language should treat "uninitialized" strings
  exactly like empty strings.
* Not doing so, resulted in a number of vulnerabilities.
  * EN$$ crashed if "_" was uninitialized
  * The ^E@q and ^ENq string building constructs would crash for existing but
    uninitialized registers q.
  * ?$ would crash
  * ESSETILEXER$$ would crash
* This is now fixed.
  Test cases have been added.
* I cannot guarantee that I have found all such cases.
  Generally, it might be wise to change our definitions and make sure that
  every teco_string_t must have an associated heap object to be valid.
  All functions returning pointer+length pairs should consequently also never
  return NULL pointers.
</pre>
</div>
</content>
</entry>
</feed>
