Skip to content

Commit e38ae1c

Browse files
committed
Merge branch 'dev'
2 parents 43bb2b1 + c3e436c commit e38ae1c

File tree

146 files changed

+6244
-4134
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+6244
-4134
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@ target_wrapper.*
4646
CMakeLists.txt.user*
4747

4848
*.pyc
49+
50+
/installer/packages/app/data/

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.3.1.{build}
1+
version: 0.3.2.{build}
22
image: Visual Studio 2019
33

44
init:

doc/release.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Prepare Release
2+
3+
1. Update version in `appveyor.yml`
4+
2. Update version in `installer/config/config.xml`
5+
3. Update version and date in `installer/packages/app/meta/package.xml`
6+
4. Update version in `src/Version.pri`
7+
8+
## Build Release
9+
Example bat script to build release
10+
11+
```
12+
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
13+
set PATH=C:\Qt\5.15.0\msvc2019_64\bin\;C:\Qt\Tools\QtCreator\bin\;%PATH%
14+
mkdir build
15+
cd build
16+
qmake ..\src\NotepadNext.pro
17+
jom
18+
jom make_package
19+
jom zip
20+
jom prepare_installer
21+
cd ..
22+
mkdir installer_build
23+
cd installer_build
24+
qmake ..\installer\installer.pro
25+
jom
26+
```

installer/config/config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Installer>
33
<Name>Notepad Next</Name>
4-
<Version>0.3.1</Version>
5-
<Title>Notepad Next v0.3.1</Title>
4+
<Version>0.3.2</Version>
5+
<Title>Notepad Next v0.3.2</Title>
66
<Publisher>Notepad Next</Publisher>
77
<StartMenuDir>Notepad Next</StartMenuDir>
88

installer/packages/app/meta/package.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0"?>
22
<Package>
33
<DisplayName>Notepad Next</DisplayName>
4-
<Description>Notepad Next v0.3.1</Description>
5-
<Version>0.3.1</Version>
4+
<Description>Notepad Next v0.3.2</Description>
5+
<Version>0.3.2</Version>
66
<ForcedInstallation>true</ForcedInstallation>
7-
<ReleaseDate>2020-07-16</ReleaseDate>
7+
<ReleaseDate>2020-08-29</ReleaseDate>
88
<!-- <RequiresAdminRights>true</RequiresAdminRights> -->
99
<Script>installscript.qs</Script>
1010
<UserInterfaces>

src/Config.pri

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@ CONFIG -= debug_and_release debug_and_release_target
2727
# Controls if we want to define our own regex engine using QRegularExpression
2828
DEFINES += SCI_OWNREGEX
2929

30+
DEFINES += ADS_STATIC
31+
3032
msvc:QMAKE_CXXFLAGS += /guard:cf
3133
msvc:QMAKE_LFLAGS += /guard:cf

src/LuaBridge/List.h

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// https://github.com/vinniefalco/LuaBridge
2+
//
3+
// Copyright 2018, Dmitry Tarakanov
4+
// SPDX-License-Identifier: MIT
5+
6+
#pragma once
7+
8+
#include <LuaBridge/detail/Stack.h>
9+
10+
#include <list>
11+
12+
namespace luabridge {
13+
14+
template <class T>
15+
struct Stack <std::list <T> >
16+
{
17+
static void push (lua_State* L, std::list <T> const& list)
18+
{
19+
lua_createtable (L, static_cast <int> (list.size ()), 0);
20+
typename std::list <T>::const_iterator item = list.begin ();
21+
for (std::size_t i = 1; i <= list.size (); ++i)
22+
{
23+
lua_pushinteger (L, static_cast <lua_Integer> (i));
24+
Stack <T>::push (L, *item);
25+
lua_settable (L, -3);
26+
++item;
27+
}
28+
}
29+
30+
static std::list <T> get (lua_State* L, int index)
31+
{
32+
if (!lua_istable (L, index))
33+
{
34+
luaL_error (L, "#%d argument must be a table", index);
35+
}
36+
37+
std::list <T> list;
38+
39+
int const absindex = lua_absindex (L, index);
40+
lua_pushnil (L);
41+
while (lua_next (L, absindex) != 0)
42+
{
43+
list.push_back (Stack <T>::get (L, -1));
44+
lua_pop (L, 1);
45+
}
46+
return list;
47+
}
48+
49+
static bool isInstance (lua_State* L, int index)
50+
{
51+
return lua_istable (L, index);
52+
}
53+
};
54+
55+
} // namespace luabridge

src/LuaBridge/LuaBridge.h

Lines changed: 22 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
//------------------------------------------------------------------------------
22
/*
33
https://github.com/vinniefalco/LuaBridge
4-
4+
5+
Copyright 2019, Dmitry Tarakanov
56
Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
67
Copyright 2007, Nathan Reed
78
@@ -27,116 +28,32 @@
2728
*/
2829
//==============================================================================
2930

30-
#ifndef LUABRIDGE_LUABRIDGE_HEADER
31-
#define LUABRIDGE_LUABRIDGE_HEADER
31+
#pragma once
3232

3333
// All #include dependencies are listed here
3434
// instead of in the individual header files.
3535
//
36-
#include <cassert>
37-
#include <sstream>
38-
#include <stdexcept>
39-
#include <string>
40-
#include <typeinfo>
4136

4237
#define LUABRIDGE_MAJOR_VERSION 2
43-
#define LUABRIDGE_MINOR_VERSION 0
44-
#define LUABRIDGE_VERSION 200
45-
46-
namespace luabridge
47-
{
48-
49-
// Forward declaration
50-
//
51-
template <class T>
52-
struct Stack;
53-
54-
#include "detail/LuaHelpers.h"
55-
56-
#include "detail/TypeTraits.h"
57-
#include "detail/TypeList.h"
58-
#include "detail/FuncTraits.h"
59-
#include "detail/Constructor.h"
60-
#include "detail/Stack.h"
61-
#include "detail/ClassInfo.h"
62-
63-
class LuaRef;
64-
65-
#include "detail/LuaException.h"
66-
#include "detail/LuaRef.h"
67-
#include "detail/Iterator.h"
68-
69-
//------------------------------------------------------------------------------
70-
/**
71-
security options.
72-
*/
73-
class Security
74-
{
75-
public:
76-
static bool hideMetatables ()
77-
{
78-
return getSettings().hideMetatables;
79-
}
80-
81-
static void setHideMetatables (bool shouldHide)
82-
{
83-
getSettings().hideMetatables = shouldHide;
84-
}
85-
86-
private:
87-
struct Settings
88-
{
89-
Settings () : hideMetatables (true)
90-
{
91-
}
92-
93-
bool hideMetatables;
94-
};
38+
#define LUABRIDGE_MINOR_VERSION 3
39+
#define LUABRIDGE_VERSION 203
9540

96-
static Settings& getSettings ()
97-
{
98-
static Settings settings;
99-
return settings;
100-
}
101-
};
102-
103-
#include "detail/Userdata.h"
104-
#include "detail/CFunctions.h"
105-
#include "detail/Namespace.h"
106-
107-
//------------------------------------------------------------------------------
108-
/**
109-
Push an object onto the Lua stack.
110-
*/
111-
template <class T>
112-
inline void push (lua_State* L, T t)
113-
{
114-
Stack <T>::push (L, t);
115-
}
116-
117-
//------------------------------------------------------------------------------
118-
/**
119-
Set a global value in the lua_State.
120-
121-
@note This works on any type specialized by `Stack`, including `LuaRef` and
122-
its table proxies.
123-
*/
124-
template <class T>
125-
inline void setGlobal (lua_State* L, T t, char const* name)
126-
{
127-
push (L, t);
128-
lua_setglobal (L, name);
129-
}
130-
131-
//------------------------------------------------------------------------------
132-
/**
133-
Change whether or not metatables are hidden (on by default).
134-
*/
135-
inline void setHideMetatables (bool shouldHide)
136-
{
137-
Security::setHideMetatables (shouldHide);
138-
}
41+
#ifndef LUA_VERSION_NUM
42+
#error "Lua headers must be included prior to LuaBridge ones"
43+
#endif
13944

140-
}
14145

142-
#endif
46+
#include <LuaBridge/detail/LuaHelpers.h>
47+
#include <LuaBridge/detail/TypeTraits.h>
48+
#include <LuaBridge/detail/TypeList.h>
49+
#include <LuaBridge/detail/FuncTraits.h>
50+
#include <LuaBridge/detail/Constructor.h>
51+
#include <LuaBridge/detail/ClassInfo.h>
52+
#include <LuaBridge/detail/LuaException.h>
53+
#include <LuaBridge/detail/LuaRef.h>
54+
#include <LuaBridge/detail/Iterator.h>
55+
#include <LuaBridge/detail/Userdata.h>
56+
#include <LuaBridge/detail/CFunctions.h>
57+
#include <LuaBridge/detail/Security.h>
58+
#include <LuaBridge/detail/Stack.h>
59+
#include <LuaBridge/detail/Namespace.h>

src/LuaBridge/Map.h

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// https://github.com/vinniefalco/LuaBridge
2+
//
3+
// Copyright 2018, Dmitry Tarakanov
4+
// SPDX-License-Identifier: MIT
5+
6+
#pragma once
7+
8+
#include <LuaBridge/detail/Stack.h>
9+
#include <LuaBridge/detail/dump.h>
10+
11+
#include <map>
12+
13+
namespace luabridge {
14+
15+
template <class K, class V>
16+
struct Stack <std::map <K, V> >
17+
{
18+
typedef std::map <K, V> Map;
19+
20+
static void push (lua_State* L, const Map& map)
21+
{
22+
lua_createtable (L, 0, static_cast <int> (map.size ()));
23+
typedef typename Map::const_iterator ConstIter;
24+
for (ConstIter i = map.begin (); i != map.end (); ++i)
25+
{
26+
Stack <K>::push (L, i->first);
27+
Stack <V>::push (L, i->second);
28+
lua_settable (L, -3);
29+
}
30+
}
31+
32+
static Map get (lua_State* L, int index)
33+
{
34+
if (!lua_istable (L, index))
35+
{
36+
luaL_error (L, "#%d argument must be a table", index);
37+
}
38+
39+
Map map;
40+
int const absindex = lua_absindex (L, index);
41+
lua_pushnil (L);
42+
while (lua_next (L, absindex) != 0)
43+
{
44+
map.emplace (Stack <K>::get (L, -2), Stack <V>::get (L, -1));
45+
lua_pop (L, 1);
46+
}
47+
return map;
48+
}
49+
50+
static bool isInstance (lua_State* L, int index)
51+
{
52+
return lua_istable (L, index);
53+
}
54+
};
55+
56+
} // namespace luabridge

0 commit comments

Comments
 (0)