Enhance: provide missing functionality for Map Room User Data

Adds lua commands:
* getAllRoomUserData(roomID): given a roomId number returns a lua table of
  all the user data.
* getRoomUserDataKeys(roomID): given a roomId number returns a lua list of
  all the keys of the user data for that room.
* clearRoomUserDataItem(roomID,key): given a roomId number and a user data
  key removes that key/value pair from the user data for that room. Returns
  true if data was removed, false if not and nil if the room does not exist
  for that roomId number.

Enhance existing commands:
* searchRoomUserData(key, value): given a string "key" and "value" returns
  a list of the roomIDs which contain that value for that key, now returns
  a sorted list of room numbers.
  Additionally extended so, in the absence of a second argument:
* searchRoomUserData(key): given a string "key" returns an ascending
  sorted list (lua table with monotonically incrementing integer keys from
  unity) of the unique values stored against that key in all rooms.

Also:
  Correct (and reformat to revised Mudlet "standard") error messages for
  setRoomUserData() {they referred to getRoomUserData() instead which was
  confusing!} and reformat getRoomUserData() error messages as well.

ALL OF THESE FUNCTIONS:
A) Return messages that can be internationalised, and will return them as
   Utf-8 encoded strings to the Lua subsystem.
B) Accept and pass Utf-8 encoded strings to and from the Lua subsystem, so
   non-ASCII text can be used both as identifiers (keys) for room user data
   items and the data (values) stored under those keys.

The searchRoomUserData functions are linear so may not be particularly fast
for large maps - the user is encouraged to develop/use their own index
systems rather than directly utilise the map room user data if they wish to
optimise actions that requires access across all or a sizeable part of a
large map.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Enhance: lua searchRoom() search, allow non-ASCII room names

Update getRoomName(), setRoomName() and searcgRoom() to handle non-ASCII
room name data.  The strings passed to and from the lua subsystem now use
Utf-8 which is a super-set of (backwards compatible with) ASCII.

Also, the original lua command when invoked as searchRoom("string") did a
case insensitive room name search and used the supplied string for a
partial search of all room names in the map.  One or two optional Boolean
arguments can be now supplement the supplied search string for the
room-name, the first, if true, makes the search case sensitive and the
second, requires the string to be a complete match rather than a sub-string
of the room name to be found.  Both of these arguments can make it easier
to find a specific room.

In the same manner as another recent commit addressing map room user data
the error messages from these three lua commands have been made capable of
being translated by the Qt internationalisation system, and the resultant
texts can be passed as utf-8 data to the lua system and to user with
non-ASCII characters.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
BugFix: close button on map custom exit dialog not cancelling line drawing

As per http://bugs.launchpad.net/mudlet/+bug/1369041 the built-in dialog
button that some OS/Window systems provide did close the dialog but did not
cancel the custom line drawing process.  This fixes the matter by
connecting the reject() signal that the button produces to code to clean
up.

During debugging this it became clear that: if the custom line dialog was
being displayed but before the user had selected the exit to draw the line
for, it was possible to click on the map and add points to create a line;
this would be for a custom line with an Empty exit name which should not be
permitted.  To prevent this a flag "mDialogLock" was added to the class to
prevent the mouse events that would draw or modify a custom line from
proceeding until the custom line dialog had been used or cancelled.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
BugFix: Prevent colouring of room exit number tool-tips on room exit dialog

As referred to in https://bugs.launchpad.net/mudlet/+bug/1369040 it has
been found that colouration applied to the room numbers displayed in the
map room exits dialog to indicate their validity was being passed onto
the tool-tips for those elements. The cure is to explicitly apply the
colouration to ONLY the QLineEdits involved.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Fixup: Remove useless sort operation

Sorting operation is ineffective in the manner it was being used, Lua does
not operate in the way that I had assumed!

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Merge pull request #212 from SlySven/enhanceAndAdd_luaMapUserDataFunctions

Enhance: provide missing functionality for Map Room User Data
Merge pull request #213 from SlySven/enhance_luaRoomNameFunctions

Enhance: lua searchRoom() search, allow non-ASCII room names
Merge pull request #215 from SlySven/fix_ExitDialogButtonOnCustomExitLineDialog

BugFix: close button on map custom exit dialog not cancelling line drawi...
Merge pull request #216 from SlySven/fix_RoomExitsDialogColouredToolTips

BugFix: Prevent colouring of exit number tool-tips on room exit dialog
Update package.cpath for OSX

Update package.cpath os it can find locally-shipped dylibs, and remove the LuaJIT cpath code as we don't use it.

This is actually currently in production for 3.0, I forgot to commit it after I made the fix.
Merge pull request #220 from vadi2/development

Update package.cpath for OSX
Add support for strikeout/strikethrough/linethrough text
Merge pull request #223 from Zahatric/CodeCleanup

Add support for strikeout/strikethrough/linethrough text
BugFix: Fix original coding errors in creating data in TArea::exits member

The specification for this member is:
    QMultiMap<int, QPair<int, int> > exits
and it is a record of the rooms that are on border on the TArea instance.
The outer QMultiMap key is the room id of the in_area room, and the value
pair is: first=out_of_area room id
         second=direction code
The original direction codes were defined at the start of the TArea.cpp
class file but there did not appear to be any logic to the values used:
N=12, NE=1, E=3, SE=4, S=6, SW=7, W=9, NW=10, UP=13, DOWN=14, IN=15,
OUT=16, OTHER=17.  Other than a lua function getAreaExits(areaId) which was
supposed to return just a list of unique keys via a TArea::getAreaExits()
method - i.e. a list of rooms in the given area which were exits to another
area, no other use was made of this data.  I propose to replace this list
of values with the better known list stored in the TRoom class header file
but as that does not currently have a value for "other" {a.k.a. Special}
exits I had added a new define: #DEFINE DIR_OTHER with the value 13.

The data IS stored in the map file but is not changed except by calls to:
* (void)TArea::ausgaengeBestimmen() called from:
    (void)TRoomDB::initAreasForOldMaps()
* (void)TArea::fast_ausgaengeBestimmen(int id) called from:
    (bool)TMap::setExit(int from, int to, int dir)
    (void)TRoom::setArea(int _areaID)
    (void)TRoom::setSpecialExit(int to, const QString & cmd)
    (void)TRoom::removeAllSpecialExitsToRoom(int _id)
    (void)dlgRoomExits::save()
* (void)TArea::removeRoom(int room) called from:
    (void)TRoom::setArea(int _areaID)
    (bool)TRoomDB::__removeRoom(int id)

The bugs are that the code in both "ausgaengeBestimmen" methods (with
and without the "fast_" prefix) used the FROM room Id as the first member
of the value pair rather than the TO (a.k.a. exit) room Id for Normal
exits and use the room ID of the TO (a.k.a. exit) room Id as the key for
Special exits (i.e. stores a room that is NOT in the relevant area as a
room IN the area that is an exit from THAT area!)  Additionally, even if
the code was correct the existing flawed data would not be corrected when
the map is loaded by running TArea::ausgaengeBestimmen() again because that
is only called at the end of TRoomDB::initAreasForOldMaps() which was
called only for old pre-version 15 map file formats (and we are currently
on 16 - though I have plans in pipeline for something that would require an
increment on that).  To further stir the faulty data up previous faulty
code that introduced problems when moving a room from one area to another
may also have contributed to errors with the TArea::exits data.

However:

tl;dr;

running the lua command "auditAreas()" runs TRoomDB::initAreasForOldMaps()
which will fix-up existing maps after this commit has been committed...!

This fixes ["getAreaExits is broken (bug 1380822)"](http://bugs.launchpad.net/mudlet/+bug/1380822) 8-)

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Revise: massage Area Exit data to required format and ensure it is correct

Rename:
(void)TArea::fast_ausgaengeBestimmen(int)
                                     ==> TArea::determineAreaExitsOfRoom
(void)TArea::ausgaengeBestimmen(int) ==> TArea::determineAreaExits
(const)(QList<int>)TArea::getAreaExits() const
                                     ==> TArea::getAreaExitRoomIds()

Add new method to return area exit data in new, wanted format:
(const)(QMultiMap<int, QPair<QString, int> >) getAreaExitRoomData() const

In preparation to revising internal storage representation of area exit
data moved the: (QMultiMap<int, QPair<int, int> >)(TArea *)->exits member
from public to private area of class.  To permit save and load the
following have had to be made friends of the TArea class:
(bool)TMap::serialize( QDataStream & ) and  (bool)TMap::restore( QString )

Revise (void)TMap::init(Host *) to run (TArea *)->determineAreaExits() on
current and all previous map file format versions, will not be needed on
future version as the code to manage the areaExits data is now functional.
Previous code would have done this only for versions prior to 14 files
(current is 16) or if the lua function auditAreas() was manually run.  In
passing also modified code that "fixed-up" "old style" map labels so that
it is no longer run on current version files and pushes any messages that
that creates into the main profile console instead of using standard C++
cout calls which we deprecate now.

All code blocks that have been touched by this series of commits have been
re-formatted to current styles.

Update copyrights on all files touched that have not already been marked as
having been edited by myself.

Revised TLuaInterpreter::getAreaExits(...) to take a second optional
Boolean that if present and true cause it to return data about the area
exit directions and the destination rooms, if false or omitted, returns
only the rooms in the area that have exits out of it, reproducing the
previous implementation.  In either case the result is a table if there
are area exits (or a nil for an isolate area without exits); two additional
values are returned an informative, translatable, text message and an
integer status code that reflects the same information.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Squash: fix use of tr() instead of translate() in two places

This would be squashed in if it were an option open to me!

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Deletion: remove prematurely inserted internationalising code

Review by other developers has suggested leaving out code that could affect
the Lua API if fully utilised and which will be redundant until a
coordinated approach to internationalising Mudlet has been decided upon.

The remainder has been left in a form that WILL raise compilation errors
if the Qt I18n helper macro QT_NO_CAST_FROM_ASCII is defined to highlight
an area that will need further attention when translation to other
languages is attempted.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>