Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
dail8859 committed Aug 29, 2020
2 parents 43bb2b1 + c3e436c commit e38ae1c
Show file tree
Hide file tree
Showing 146 changed files with 6,244 additions and 4,134 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ target_wrapper.*
CMakeLists.txt.user*

*.pyc

/installer/packages/app/data/
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.3.1.{build}
version: 0.3.2.{build}
image: Visual Studio 2019

init:
Expand Down
26 changes: 26 additions & 0 deletions doc/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Prepare Release

1. Update version in `appveyor.yml`
2. Update version in `installer/config/config.xml`
3. Update version and date in `installer/packages/app/meta/package.xml`
4. Update version in `src/Version.pri`

## Build Release
Example bat script to build release

```
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
set PATH=C:\Qt\5.15.0\msvc2019_64\bin\;C:\Qt\Tools\QtCreator\bin\;%PATH%
mkdir build
cd build
qmake ..\src\NotepadNext.pro
jom
jom make_package
jom zip
jom prepare_installer
cd ..
mkdir installer_build
cd installer_build
qmake ..\installer\installer.pro
jom
```
4 changes: 2 additions & 2 deletions installer/config/config.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>Notepad Next</Name>
<Version>0.3.1</Version>
<Title>Notepad Next v0.3.1</Title>
<Version>0.3.2</Version>
<Title>Notepad Next v0.3.2</Title>
<Publisher>Notepad Next</Publisher>
<StartMenuDir>Notepad Next</StartMenuDir>

Expand Down
6 changes: 3 additions & 3 deletions installer/packages/app/meta/package.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0"?>
<Package>
<DisplayName>Notepad Next</DisplayName>
<Description>Notepad Next v0.3.1</Description>
<Version>0.3.1</Version>
<Description>Notepad Next v0.3.2</Description>
<Version>0.3.2</Version>
<ForcedInstallation>true</ForcedInstallation>
<ReleaseDate>2020-07-16</ReleaseDate>
<ReleaseDate>2020-08-29</ReleaseDate>
<!-- <RequiresAdminRights>true</RequiresAdminRights> -->
<Script>installscript.qs</Script>
<UserInterfaces>
Expand Down
2 changes: 2 additions & 0 deletions src/Config.pri
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ CONFIG -= debug_and_release debug_and_release_target
# Controls if we want to define our own regex engine using QRegularExpression
DEFINES += SCI_OWNREGEX

DEFINES += ADS_STATIC

msvc:QMAKE_CXXFLAGS += /guard:cf
msvc:QMAKE_LFLAGS += /guard:cf
55 changes: 55 additions & 0 deletions src/LuaBridge/List.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// https://github.com/vinniefalco/LuaBridge
//
// Copyright 2018, Dmitry Tarakanov
// SPDX-License-Identifier: MIT

#pragma once

#include <LuaBridge/detail/Stack.h>

#include <list>

namespace luabridge {

template <class T>
struct Stack <std::list <T> >
{
static void push (lua_State* L, std::list <T> const& list)
{
lua_createtable (L, static_cast <int> (list.size ()), 0);
typename std::list <T>::const_iterator item = list.begin ();
for (std::size_t i = 1; i <= list.size (); ++i)
{
lua_pushinteger (L, static_cast <lua_Integer> (i));
Stack <T>::push (L, *item);
lua_settable (L, -3);
++item;
}
}

static std::list <T> get (lua_State* L, int index)
{
if (!lua_istable (L, index))
{
luaL_error (L, "#%d argument must be a table", index);
}

std::list <T> list;

int const absindex = lua_absindex (L, index);
lua_pushnil (L);
while (lua_next (L, absindex) != 0)
{
list.push_back (Stack <T>::get (L, -1));
lua_pop (L, 1);
}
return list;
}

static bool isInstance (lua_State* L, int index)
{
return lua_istable (L, index);
}
};

} // namespace luabridge
127 changes: 22 additions & 105 deletions src/LuaBridge/LuaBridge.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//------------------------------------------------------------------------------
/*
https://github.com/vinniefalco/LuaBridge
Copyright 2019, Dmitry Tarakanov
Copyright 2012, Vinnie Falco <[email protected]>
Copyright 2007, Nathan Reed
Expand All @@ -27,116 +28,32 @@
*/
//==============================================================================

#ifndef LUABRIDGE_LUABRIDGE_HEADER
#define LUABRIDGE_LUABRIDGE_HEADER
#pragma once

// All #include dependencies are listed here
// instead of in the individual header files.
//
#include <cassert>
#include <sstream>
#include <stdexcept>
#include <string>
#include <typeinfo>

#define LUABRIDGE_MAJOR_VERSION 2
#define LUABRIDGE_MINOR_VERSION 0
#define LUABRIDGE_VERSION 200

namespace luabridge
{

// Forward declaration
//
template <class T>
struct Stack;

#include "detail/LuaHelpers.h"

#include "detail/TypeTraits.h"
#include "detail/TypeList.h"
#include "detail/FuncTraits.h"
#include "detail/Constructor.h"
#include "detail/Stack.h"
#include "detail/ClassInfo.h"

class LuaRef;

#include "detail/LuaException.h"
#include "detail/LuaRef.h"
#include "detail/Iterator.h"

//------------------------------------------------------------------------------
/**
security options.
*/
class Security
{
public:
static bool hideMetatables ()
{
return getSettings().hideMetatables;
}

static void setHideMetatables (bool shouldHide)
{
getSettings().hideMetatables = shouldHide;
}

private:
struct Settings
{
Settings () : hideMetatables (true)
{
}

bool hideMetatables;
};
#define LUABRIDGE_MINOR_VERSION 3
#define LUABRIDGE_VERSION 203

static Settings& getSettings ()
{
static Settings settings;
return settings;
}
};

#include "detail/Userdata.h"
#include "detail/CFunctions.h"
#include "detail/Namespace.h"

//------------------------------------------------------------------------------
/**
Push an object onto the Lua stack.
*/
template <class T>
inline void push (lua_State* L, T t)
{
Stack <T>::push (L, t);
}

//------------------------------------------------------------------------------
/**
Set a global value in the lua_State.
@note This works on any type specialized by `Stack`, including `LuaRef` and
its table proxies.
*/
template <class T>
inline void setGlobal (lua_State* L, T t, char const* name)
{
push (L, t);
lua_setglobal (L, name);
}

//------------------------------------------------------------------------------
/**
Change whether or not metatables are hidden (on by default).
*/
inline void setHideMetatables (bool shouldHide)
{
Security::setHideMetatables (shouldHide);
}
#ifndef LUA_VERSION_NUM
#error "Lua headers must be included prior to LuaBridge ones"
#endif

}

#endif
#include <LuaBridge/detail/LuaHelpers.h>
#include <LuaBridge/detail/TypeTraits.h>
#include <LuaBridge/detail/TypeList.h>
#include <LuaBridge/detail/FuncTraits.h>
#include <LuaBridge/detail/Constructor.h>
#include <LuaBridge/detail/ClassInfo.h>
#include <LuaBridge/detail/LuaException.h>
#include <LuaBridge/detail/LuaRef.h>
#include <LuaBridge/detail/Iterator.h>
#include <LuaBridge/detail/Userdata.h>
#include <LuaBridge/detail/CFunctions.h>
#include <LuaBridge/detail/Security.h>
#include <LuaBridge/detail/Stack.h>
#include <LuaBridge/detail/Namespace.h>
56 changes: 56 additions & 0 deletions src/LuaBridge/Map.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// https://github.com/vinniefalco/LuaBridge
//
// Copyright 2018, Dmitry Tarakanov
// SPDX-License-Identifier: MIT

#pragma once

#include <LuaBridge/detail/Stack.h>
#include <LuaBridge/detail/dump.h>

#include <map>

namespace luabridge {

template <class K, class V>
struct Stack <std::map <K, V> >
{
typedef std::map <K, V> Map;

static void push (lua_State* L, const Map& map)
{
lua_createtable (L, 0, static_cast <int> (map.size ()));
typedef typename Map::const_iterator ConstIter;
for (ConstIter i = map.begin (); i != map.end (); ++i)
{
Stack <K>::push (L, i->first);
Stack <V>::push (L, i->second);
lua_settable (L, -3);
}
}

static Map get (lua_State* L, int index)
{
if (!lua_istable (L, index))
{
luaL_error (L, "#%d argument must be a table", index);
}

Map map;
int const absindex = lua_absindex (L, index);
lua_pushnil (L);
while (lua_next (L, absindex) != 0)
{
map.emplace (Stack <K>::get (L, -2), Stack <V>::get (L, -1));
lua_pop (L, 1);
}
return map;
}

static bool isInstance (lua_State* L, int index)
{
return lua_istable (L, index);
}
};

} // namespace luabridge
Loading

0 comments on commit e38ae1c

Please sign in to comment.