Mirror of Lyx repo
Go to file
Hashini Senaratne 5a361b35cf Keyboard based horizontal scrolling for wide insets
[This commit is the output of the "horizontal scrolling" GSoC 2013
 project, by Hashini Senaratne. The code has been cleaned up, some
 variables have been renamed and moved from the Cursor class to
 BufferView::Private. This is the base from which I (jmarc) will polish
 the feature for landing on master.

 Below is the original commit log of Hashini, updated to reflect the
 changes that have been done.]

This feature also applicable for other insets; graphics and labels.

This implementation is capable of scrolling a single row when reaching
its content which is beyond the screen limits, using left and right
arrow keys.

The attribute 'horiz_scroll_offset_' introduced in the
BufferView::Private class plays a main role in horizontal scrolling of
the wide rows that grow beyond the screen limits. This attribute
represents by how much pixels the current row that the text cursor
lies in should be get scrolled.

The main logic that is responsible for drawing the scrolled rows is
within the BufferView class, BufferView::checkCursorScrollOffset.

 * The main logic is called via BufferView::draw.

 * What this does is set the horiz_scroll_offset_ attribute in in order to
 show the position that the text cursor lies in.

 * To make sure that BufferView::draw gets involved when Update flag is
 FitCursor, necessary changes are made in BufferView::processUpdateFlags.

Basically what the logic that used to set the horiz_scroll_offset_
does is,

 * The row which the text cursor lies in is identified by a
 CursorSlice that points to the beginning of the row. This is the
 'rowSlice' variable used in BufferView::checkCursorScrollOffset. Acessors
 are added to obtain this variable. Here row objects were not used to
 identify the current row, because it appears that row objects can
 disappear when doing a decoration update for example. This means that
 comparing row pointers is not a good idea, because they can change
 without notice.

 * Stop calculations of horiz_scroll_offset_ variable, if metrics have not been
 computed yet. Otherwise the calls to TextMetrics::parMetrics, calls
 redoParagraph and may change the row heigths. Therefore vertical scrolling
 feature may get disturbed. This is avoided.

 * Using BufferView::::setCurrentRowSlice resets horiz_scroll_offset_
 when changing cursor row. This is done in order to prevent unwanted
 scrolling that happens when changing the selected row using up and
 down arrow keys.

 * Recompute inset positions before checking scoll offset of the row, by
 painting the row insets with drawing disabled. This is done because the
 position of insets is computed within the drawing procedure.

 * Current x position of the text cursor is compared with the
 horiz_scroll_offset_ value and the other variables like row.width(),
 bv.workWidth(). Compute the new horiz_scroll_offset_ value in order
 to show where the text cursor lies in. The basics conditions that we
 check before recomputing it are, if the text cursor lies rightward to
 the current right screen boundary, if the text cursor lies leftward
 to the current left screen boundary, if the text cursor lies within
 screen boundaries but the length of the row is less than the left
 boundary of the screen (this happens when we delete some content of
 the row using delete key or backspace key).

 * Change update strategy when scrooll offset has changed. This allows to
 redraw the row when no drawing was scheduled. By doing so, it was
 possible to redraw a wide row when moving to the leftmost position of the
 wide row, from the leftmost position of the row below, using the left
 arrow key.

In TextMetrics::drawParagraph it is checked whether the current row is
what is drawing now. If it is so, the value used to the x value of the row
for drawing is adapted according to BufferView::horizScrollOffset.

The method used to pass boundary() was fixed to get row when cursor was in
a nested inset. This matter is considered in Cursor::textRow and it is
modified accordingly.

GuiWorkArea::Private::showCursor() is modified to show the cursor position
in a scrolled row.
2015-01-07 22:55:11 +01:00
boost Fix compilation on Solaris after last boost upgrade. 2014-05-29 22:31:56 +02:00
config Update autotools for building with Qt5. 2014-07-19 03:34:28 +02:00
development avoid qt4 variable names in cmake build 2014-07-21 08:49:05 +02:00
lib Merge remote-tracking branch 'features/str-metrics' 2014-07-25 20:10:55 +02:00
m4 Add some more m4 macro files for gettext 2013-06-03 15:37:13 +02:00
po * sk.po: New pdfcomment strings 2014-07-03 17:30:02 +02:00
sourcedoc Setup .gitignore for generated files 2012-03-22 02:16:12 +01:00
src Keyboard based horizontal scrolling for wide insets 2015-01-07 22:55:11 +01:00
.gitignore Add a couple more ignores: patches, and the build directory. 2014-01-29 11:24:22 -05:00
ANNOUNCE Typo. 2014-04-10 19:17:05 -07:00
autogen.sh enable automake version 1.14 2013-07-26 13:04:32 +02:00
CMakeLists.txt avoid qt4 variable names in cmake build 2014-07-21 08:49:05 +02:00
configure.ac Update autotools for building with Qt5. 2014-07-19 03:34:28 +02:00
COPYING
INSTALL Update autotools for building with Qt5. 2014-07-19 03:34:28 +02:00
INSTALL.autoconf
INSTALL.cmake CMake: Remove libintl 2013-05-30 22:10:01 +02:00
INSTALL.MacOSX Update autotools for building with Qt5. 2014-07-19 03:34:28 +02:00
INSTALL.Win32 INSTALL.Win32: correct a path 2013-06-02 17:14:42 +02:00
lyx.1in Fix man page, patch from Prannoy Pilligundla. 2014-04-19 10:26:47 -07:00
Makefile.am Execute lyx2lyx unit test when running tests 2014-05-29 14:57:05 +02:00
NEWS Add news from 2.0.8. 2014-04-11 11:48:00 -04:00
README Update our documentation to mention git instead of svn. 2013-05-27 18:19:59 +02:00
README.Cygwin Get rid of all traces of libintl. 2013-05-30 22:10:01 +02:00
README.localization README.localization: a precision 2014-04-27 16:02:47 +02:00
README.Win32 update info 2011-02-14 21:26:44 +00:00
RELEASE-NOTES Release notes: Remove entry about BibTeX errors 2014-04-10 22:29:38 +02:00
UPGRADING Move caveats from 2.0.0:RELEASE-NOTES to UPGRADING 2013-08-05 11:57:53 +02:00

What is LyX?

    LyX is a document processor that encourages an approach to
    writing based on the structure of your documents, not their
    appearance. It is released under a Free Software / Open Source
    license.

    LyX is for people that write and want their writing to look great,
    right out of the box. No more endless tinkering with formatting
    details, 'finger painting' font attributes or futzing around with
    page boundaries. You just write. In the background, Prof. Knuth's
    legendary TeX typesetting engine makes you look good.

    On screen, LyX looks like any word processor; its printed output
    -- or richly cross-referenced PDF, just as readily produced --
    looks like nothing else. Gone are the days of industrially bland
    .docs, all looking similarly not-quite-right, yet coming out
    unpredictably different on different printer drivers. Gone are the
    crashes 'eating' your dissertation the evening before going to
    press.

    LyX is stable and fully featured. It is a multi-platform, fully
    internationalized application running natively on Unix/Linux and
    the Macintosh and modern Windows platforms.

What do I need to run LyX?

    Either:
    * a Unix-like system (including Windows with cygwin)
    * Windows 2000 or newer
    * Mac OS 10.4 or newer

    A decent LaTeX2e installation (e.g. TeX Live for Linux, MikTeX for
    Windows).

    Python 2.4 or later to convert old LyX files and for helper scripts.
    Note 1: Python 2.4 or later is required due to the subprocess module.
    Note 2: Python 2.6 or later is recommended on Windows.
    Note 3: Python 3.0 or later is not supported.

How does the LyX version scheme work?

    LyX uses a contiguous numbering scheme for versions, where a
    number "1.x.y" indicates a stable release '1.x', maintenance
    release 'y'.  In other words, LyX 1.5.0 was the first stable
    release in the 1.5-series of LyX. At the time of writing, the
    latest maintenance release in the 1.5-series was LyX 1.5.2

    Please note that maintenance releases are designed primarily to
    fix bugs, and that the file format will _never_ change due to a
    maintenance release.

    In addition to the stable releases and maintenance releases, some
    users may want to give a ''release candidate'' a try. This is a
    release that should be stable enough for daily work, but yet may
    be potentially unstable. If no major bugs are found, the release
    candiate is soon released as the first stable release in a a new
    series. To summarize, there are three possible types of file names
    that are of interest to normal users:

       lyx-1.5.0.tar.gz     -- stable release, first in the 1.5-series
       lyx-1.5.5.tar.gz     -- fifth maintenance release of LyX 1.5
       lyx-1.5.0rc1.tar.gz  -- potentially unstable release candidate

    Note that the goal is not parallel development as for the linux
    kernel --the team is too small to afford that-- but rather to
    include all the simple and safe bug fixes. This is so that the
    maintenance burden on us is not too high, and so that system
    administrators can install new releases without fear. Experience
    shows that these releases will contain a few new features, and
    that the bulk of the patches will be documentation updates.

    If you get the source from Git, the version string will look like
    one of:

       2.0.6dev     -- this is the stable branch on which maintenance
               release 2.0.6 will eventually be tagged.
       2.1.0dev     -- this is the main branch on which stable
               release 2.1.0 will eventually be tagged.

What's new?

    Read NEWS.

How do I upgrade from an earlier LyX version?

    Read the file UPGRADING for info on this subject.

What do I need to compile LyX from the source distribution?

    * A good C++ compiler.  Development is being done mainly with
      gcc/g++, but some others work also. As of LyX 1.6.0, you need at
      least gcc 3.2.x.

    * The Qt4 library, at least version 4.5.0. For all features
      newer versions (e.g. Qt 4.8) are recommended.

    Read the file "INSTALL" for more information on compiling.

Okay, I've installed LyX. What now?

    Once you've installed it, and everything looks fine, go read
    the "Introduction" item under the Help menu.  You should follow
    the instructions there, which tell you to read (or at least skim)
    the Tutorial. After that, you should also read "Help>LaTeX
    configuration" which provides info on your LaTeX configuration
    as LyX sees it.  You might be missing a package or two that you'd
    like to have.

    User-level configuration is possible via the Tools>Preferences menu.

Does LyX have support for non-English speakers/writers/readers?

    Yes. LyX supports writing in many languages, including
    right-to-left languages like Arabic or Hebrew.

    Menus and error messages have been translated to many languages.
    For the status of the different translations, see
    http://www.lyx.org/I18n

    Keymaps can ease typing in many languages.

Internet resources of relevance to LyX

    The LyX homepage contains valuable information about LyX and the
    various LyX mailing lists, as well as links to mirrors and other
    LyX homepages around the world:
	http://www.lyx.org/

    The LyX Wiki is the place where users can share information on
    setting up and using LyX.
	http://wiki.lyx.org/

    The main LyX archive site:
	ftp://ftp.lyx.org/pub/lyx/

    The LyX Development page has information about the development
    effort. LyX is under Git version control, so you can get the very
    latest sources from there at any time.
	http://www.lyx.org/Development

How do I submit a bug report?

    If possible, read the Introduction found under the Help menu in LyX.
    You'll find detailed info on submitting bug reports there.

    If you can't do that, send details to the LyX Developers' mailing
    list, or use the LyX bug tracker at
    http://www.lyx.org/trac/wiki/BugTrackerHome.
    Don't forget to mention which version you are having problems with!

How can I participate in the development of LyX?

    Any help with the development of LyX is greatly appreciated ---
    after all, LyX wouldn't be what it is today without the help
    of volunteers. We need your help!

    If you want to work on LyX, you should contact the developer's
    mailing list for discussion on how to do your stuff.  LyX is being
    cleaned up, and therefore it's important to follow some rules.
    Read about those rules in development/Code_rules/.

    If you don't know C++, there are many other ways to
    contribute. Write documentation. Help to internationalize LyX
    by translating documentation or menus/error messages, or by
    writing a new keymap. Write a new textclass. Find bugs (but
    please read the list of known bugs first). Contribute money.
    Or just offer feature suggestions (but please read the online
    TODO list first).

Thank you for trying LyX. We appreciate your feedback in the mailing
lists.

The LyX Team.