Merge remote-tracking branch 'nana_jh/develop' into dev_nana_fs
* nana_jh/develop: restore travis and CMakeLists fix missing ~other_tag, remove some warings fix crash that deprecation is included in NANA_IGNORE_CONF debug travis debug travis debug travis debug travis debug travis debug travis debug travis debug travis debug travis debug travis debug travis debug crash for travis debug a crash for travis debug a crash for travis
This commit is contained in:
@@ -141,10 +141,10 @@ endif(UNIX)
|
|||||||
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") # Clang || GNU
|
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") # Clang || GNU
|
||||||
|
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 -Wall") # Clang
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14 -Wall -g") # Clang
|
||||||
|
|
||||||
else ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
else ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall") # GNU
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -g") # GNU
|
||||||
|
|
||||||
endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
|
|
||||||
|
|||||||
@@ -1,43 +1,53 @@
|
|||||||
#Nana C++ Library
|
#Nana C++ Library
|
||||||
#
|
#
|
||||||
#Makefile created by Jinhao(cnjinhao@hotmail.com)
|
#Makefile created by sarrow104(sarrow104@gmail.com)
|
||||||
|
|
||||||
GCC = g++
|
GCC = g++
|
||||||
INCROOT = ../../include
|
INCROOT = ../../include
|
||||||
SRCROOT = ../../source
|
SRCROOT = ../../source
|
||||||
EXTRLIB = ../../extrlib
|
EXTRLIB = ../../extrlib
|
||||||
NANA_INC= $(INCROOT)/nana
|
NANA_INC= $(INCROOT)/nana
|
||||||
|
OUTROOT = out
|
||||||
|
#CXXFLAGS= -g -std=c++11 -Wall
|
||||||
|
CXXFLAGS= -g -fexceptions -std=c++11 -Wall -Wextra -Wunused-variable -Wfatal-errors
|
||||||
|
|
||||||
INCS = -I$(INCROOT) -I/usr/include/freetype2 -I$(EXTRLIB)
|
INCS = -I$(INCROOT) -I/usr/include/freetype2 -I$(EXTRLIB)
|
||||||
|
|
||||||
BIN = libnana.a
|
BIN = libnana.a
|
||||||
|
|
||||||
SRC_NANA = $(wildcard $(SRCROOT)/*.cpp)
|
TARGET = ../bin/$(BIN)
|
||||||
SRC_DETAIL = $(wildcard $(SRCROOT)/detail/*.cpp)
|
|
||||||
SRC_FILESYSTEM = $(wildcard $(SRCROOT)/filesystem/*.cpp)
|
|
||||||
SRC_AUDIO = $(wildcard $(SRCROOT)/audio/*.cpp)
|
|
||||||
SRC_AUDIO_DETAIL = $(wildcard $(SRCROOT)/audio/detail/*.cpp)
|
|
||||||
SRC_GUI = $(wildcard $(SRCROOT)/gui/*.cpp)
|
|
||||||
SRC_GUI_DETAIL = $(wildcard $(SRCROOT)/gui/detail/*.cpp)
|
|
||||||
SRC_GUI_WIDGETS = $(wildcard $(SRCROOT)/gui/widgets/*.cpp)
|
|
||||||
SRC_GUI_WIDGETS_SKELETONS = $(wildcard $(SRCROOT)/gui/widgets/skeletons/*.cpp)
|
|
||||||
SRC_PAINT = $(wildcard $(SRCROOT)/paint/*.cpp)
|
|
||||||
SRC_PAINT_DETAIL = $(wildcard $(SRCROOT)/paint/detail/*.cpp)
|
|
||||||
SRC_SYSTEM = $(wildcard $(SRCROOT)/system/*.cpp)
|
|
||||||
SRC_THREADS= $(wildcard $(SRCROOT)/threads/*.cpp)
|
|
||||||
|
|
||||||
SOURCES = $(SRC_NANA) $(SRC_DETAIL) $(SRC_FILESYSTEM) $(SRC_AUDIO) $(SRC_AUDIO_DETAIL) $(SRC_GUI) $(SRC_GUI_DETAIL) $(SRC_GUI_WIDGETS) $(SRC_GUI_WIDGETS_SKELETONS) $(SRC_PAINT) $(SRC_PAINT_DETAIL) $(SRC_SYSTEM) $(SRC_THREADS)
|
.PHONY: all clean install print
|
||||||
|
|
||||||
LINKOBJ = $(SOURCES:.cpp=.o)
|
all: $(TARGET)
|
||||||
|
|
||||||
$(BIN): $(LINKOBJ)
|
define walk
|
||||||
ar r ../bin/$(BIN) $(LINKOBJ)
|
$(wildcard $(1)) $(foreach e, $(wildcard $(1)/*), $(call walk, $(e)))
|
||||||
ranlib ../bin/$(BIN)
|
endef
|
||||||
|
|
||||||
.cpp.o:
|
SRCFILES := $(filter %.cpp,$(patsubst ./%,%,$(filter-out .,$(call walk, $(SRCROOT)))))
|
||||||
$(GCC) -g -c $< -o $@ $(INCS) -std=c++11 -Wall
|
|
||||||
|
LINKOBJ = $(patsubst $(SRCROOT)/%.cpp,$(OUTROOT)/objs/%.o,$(SRCFILES))
|
||||||
|
|
||||||
|
print:
|
||||||
|
@echo $(LINKOBJ)
|
||||||
|
|
||||||
|
$(TARGET): $(LINKOBJ)
|
||||||
|
mkdir -p $(dir $@)
|
||||||
|
ar rus $@ $?
|
||||||
|
ranlib $@
|
||||||
|
|
||||||
|
$(OUTROOT)/objs/%.o: $(SRCROOT)/%.cpp
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
$(GCC) -o $@ -c $< $(INCS) $(CXXFLAGS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(LINKOBJ)
|
rm -f $(LINKOBJ)
|
||||||
rm -f ../bin/$(BIN)
|
rm -f $(TARGET)
|
||||||
|
|
||||||
|
install:
|
||||||
|
@mkdir -p $(INSTALL_PREFIX)/include
|
||||||
|
@mkdir -p $(INSTALL_PREFIX)/bin
|
||||||
|
@mkdir -p $(INSTALL_PREFIX)/lib
|
||||||
|
cp -rfl $(INCROOT)/* $(INSTALL_PREFIX)/include
|
||||||
|
cp -rfl $(TARGET) $(INSTALL_PREFIX)/lib/
|
||||||
|
|||||||
@@ -25,7 +25,11 @@
|
|||||||
|
|
||||||
#include "c++defines.hpp"
|
#include "c++defines.hpp"
|
||||||
|
|
||||||
//The basic configurations are ignored when NANA_IGNORE_CONF is defined.
|
//This marco is defined since 1.4 and until 1.5 for deprecating frame widget.
|
||||||
|
//This marco and class frame will be removed in version 1.5
|
||||||
|
#define WIDGET_FRAME_DEPRECATED
|
||||||
|
|
||||||
|
//The following basic configurations are ignored when NANA_IGNORE_CONF is defined.
|
||||||
//The NANA_IGNORE_CONF may be specified by CMake generated makefile.
|
//The NANA_IGNORE_CONF may be specified by CMake generated makefile.
|
||||||
#ifndef NANA_IGNORE_CONF
|
#ifndef NANA_IGNORE_CONF
|
||||||
|
|
||||||
@@ -93,10 +97,6 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//This marco is defined since 1.4 and until 1.5 for deprecating frame widget.
|
|
||||||
//This marco and class frame will be removed in version 1.5
|
|
||||||
#define WIDGET_FRAME_DEPRECATED
|
|
||||||
|
|
||||||
///////////////////
|
///////////////////
|
||||||
// Support for NANA_AUTOMATIC_GUI_TESTING
|
// Support for NANA_AUTOMATIC_GUI_TESTING
|
||||||
// Will cause the program to self-test the GUI. A default automatic GUI test
|
// Will cause the program to self-test the GUI. A default automatic GUI test
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ namespace detail
|
|||||||
rectangle effect_range_;
|
rectangle effect_range_;
|
||||||
};//end class caret
|
};//end class caret
|
||||||
|
|
||||||
|
|
||||||
/// Define some constant about tab category, these flags can be combine with operator |
|
/// Define some constant about tab category, these flags can be combine with operator |
|
||||||
struct tab_type
|
struct tab_type
|
||||||
{
|
{
|
||||||
@@ -75,7 +76,6 @@ namespace detail
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class caret;
|
|
||||||
|
|
||||||
/// a window data structure descriptor
|
/// a window data structure descriptor
|
||||||
struct basic_window
|
struct basic_window
|
||||||
@@ -212,7 +212,9 @@ namespace detail
|
|||||||
|
|
||||||
struct attr_root_tag
|
struct attr_root_tag
|
||||||
{
|
{
|
||||||
|
#ifndef WIDGET_FRAME_DEPRECATED
|
||||||
container frames; ///< initialization is null, it will be created while creating a frame widget. Refer to WindowManager::create_frame
|
container frames; ///< initialization is null, it will be created while creating a frame widget. Refer to WindowManager::create_frame
|
||||||
|
#endif
|
||||||
container tabstop;
|
container tabstop;
|
||||||
std::vector<edge_nimbus_action> effects_edge_nimbus;
|
std::vector<edge_nimbus_action> effects_edge_nimbus;
|
||||||
basic_window* focus{nullptr};
|
basic_window* focus{nullptr};
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
* @file: nana/gui/detail/window_manager.hpp
|
* @file: nana/gui/detail/window_manager.hpp
|
||||||
*
|
*
|
||||||
* <Knowledge: 1, 2007-8-17, "Difference between destroy and destroy_handle">
|
* <Knowledge: 1, 2007-8-17, "Difference between destroy and destroy_handle">
|
||||||
* destroy method destroys a window handle and the handles of its children, but it doesn't delete the handle which type is a root window or a frame
|
* destroy method destroys a window handle and the handles of its children, but it doesn't delete the handle which type is a root window
|
||||||
* destroy_handle method just destroys the handle which type is a root window or a frame
|
* destroy_handle method just destroys the handle which type is a root window
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -449,7 +449,7 @@ namespace std
|
|||||||
//template< >
|
//template< >
|
||||||
std::string put_time/*<char, std::string>*/(const std::tm* tmb, const char* fmt)
|
std::string put_time/*<char, std::string>*/(const std::tm* tmb, const char* fmt)
|
||||||
{
|
{
|
||||||
unsigned sz = 200;
|
std::size_t sz = 200;
|
||||||
std::string str(sz, '\0');
|
std::string str(sz, '\0');
|
||||||
sz = std::strftime(&str[0], str.size() - 1, fmt, tmb);
|
sz = std::strftime(&str[0], str.size() - 1, fmt, tmb);
|
||||||
str.resize(sz);
|
str.resize(sz);
|
||||||
|
|||||||
@@ -211,19 +211,24 @@ namespace nana
|
|||||||
basic_window::other_tag::other_tag(category::flags categ)
|
basic_window::other_tag::other_tag(category::flags categ)
|
||||||
: category(categ), active_window(nullptr), upd_state(update_state::none)
|
: category(categ), active_window(nullptr), upd_state(update_state::none)
|
||||||
{
|
{
|
||||||
|
#ifndef WIDGET_FRAME_DEPRECATED
|
||||||
switch(categ)
|
switch(categ)
|
||||||
{
|
{
|
||||||
case category::flags::root:
|
case category::flags::root:
|
||||||
attribute.root = new attr_root_tag;
|
attribute.root = new attr_root_tag;
|
||||||
break;
|
break;
|
||||||
#ifndef WIDGET_FRAME_DEPRECATED
|
|
||||||
case category::flags::frame:
|
case category::flags::frame:
|
||||||
attribute.frame = new attr_frame_tag;
|
attribute.frame = new attr_frame_tag;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
attribute.root = nullptr;
|
attribute.root = nullptr;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (category::flags::root == categ)
|
||||||
|
attribute.root = new attr_root_tag;
|
||||||
|
else
|
||||||
|
attribute.root = nullptr;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
basic_window::other_tag::~other_tag()
|
basic_window::other_tag::~other_tag()
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include <iostream> //debug travis
|
||||||
|
|
||||||
namespace nana
|
namespace nana
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -92,7 +94,9 @@ namespace detail
|
|||||||
{
|
{
|
||||||
void operator()(basic_window* wd) const
|
void operator()(basic_window* wd) const
|
||||||
{
|
{
|
||||||
|
std::cout << "delete basic_window " << wd <<" category="<<static_cast<int>(wd->other.category)<< std::endl;
|
||||||
delete wd;
|
delete wd;
|
||||||
|
std::cout << " delete successfully" << std::endl;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2078,7 +2078,7 @@ namespace nana
|
|||||||
|
|
||||||
unsigned x_offset() const
|
unsigned x_offset() const
|
||||||
{
|
{
|
||||||
return (h.empty() ? 0 : h.value());
|
return static_cast<unsigned>(h.empty() ? 0 : h.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
index_pair offset_y_abs, offset_y_dpl; //cat stands for category, item stands for item. "item == npos" means that is a category.
|
index_pair offset_y_abs, offset_y_dpl; //cat stands for category, item stands for item. "item == npos" means that is a category.
|
||||||
|
|||||||
@@ -3451,7 +3451,7 @@ namespace nana{ namespace widgets
|
|||||||
|
|
||||||
unsigned text_editor::_m_char_by_pixels(const unicode_bidi::entity& ent, unsigned pos)
|
unsigned text_editor::_m_char_by_pixels(const unicode_bidi::entity& ent, unsigned pos)
|
||||||
{
|
{
|
||||||
unsigned len = ent.end - ent.begin;
|
auto len = static_cast<std::size_t>(ent.end - ent.begin);
|
||||||
|
|
||||||
std::unique_ptr<unsigned[]> pxbuf(new unsigned[len]);
|
std::unique_ptr<unsigned[]> pxbuf(new unsigned[len]);
|
||||||
if (graph_.glyph_pixels(ent.begin, len, pxbuf.get()))
|
if (graph_.glyph_pixels(ent.begin, len, pxbuf.get()))
|
||||||
|
|||||||
@@ -627,7 +627,7 @@ namespace nana
|
|||||||
std::unique_ptr<unsigned[]> pixels(new unsigned[text.size()]);
|
std::unique_ptr<unsigned[]> pixels(new unsigned[text.size()]);
|
||||||
graph_.glyph_pixels(text.c_str(), text.size(), pixels.get());
|
graph_.glyph_pixels(text.c_str(), text.size(), pixels.get());
|
||||||
|
|
||||||
unsigned substr_len = 0;
|
std::size_t substr_len = 0;
|
||||||
unsigned substr_px = 0;
|
unsigned substr_px = 0;
|
||||||
|
|
||||||
if (align::right == text_align_ex_)
|
if (align::right == text_align_ex_)
|
||||||
|
|||||||
Reference in New Issue
Block a user