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:
commit
d7a1c66b79
@ -141,10 +141,10 @@ endif(UNIX)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") # Clang || GNU
|
||||
|
||||
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")
|
||||
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")
|
||||
|
||||
|
@ -1,43 +1,53 @@
|
||||
#Nana C++ Library
|
||||
#
|
||||
#Makefile created by Jinhao(cnjinhao@hotmail.com)
|
||||
#Makefile created by sarrow104(sarrow104@gmail.com)
|
||||
|
||||
GCC = g++
|
||||
INCROOT = ../../include
|
||||
SRCROOT = ../../source
|
||||
EXTRLIB = ../../extrlib
|
||||
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)
|
||||
|
||||
BIN = libnana.a
|
||||
|
||||
SRC_NANA = $(wildcard $(SRCROOT)/*.cpp)
|
||||
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)
|
||||
TARGET = ../bin/$(BIN)
|
||||
|
||||
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)
|
||||
ar r ../bin/$(BIN) $(LINKOBJ)
|
||||
ranlib ../bin/$(BIN)
|
||||
define walk
|
||||
$(wildcard $(1)) $(foreach e, $(wildcard $(1)/*), $(call walk, $(e)))
|
||||
endef
|
||||
|
||||
.cpp.o:
|
||||
$(GCC) -g -c $< -o $@ $(INCS) -std=c++11 -Wall
|
||||
SRCFILES := $(filter %.cpp,$(patsubst ./%,%,$(filter-out .,$(call walk, $(SRCROOT)))))
|
||||
|
||||
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:
|
||||
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"
|
||||
|
||||
//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.
|
||||
#ifndef NANA_IGNORE_CONF
|
||||
|
||||
@ -93,10 +97,6 @@
|
||||
#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
|
||||
// Will cause the program to self-test the GUI. A default automatic GUI test
|
||||
|
@ -64,6 +64,7 @@ namespace detail
|
||||
rectangle effect_range_;
|
||||
};//end class caret
|
||||
|
||||
|
||||
/// Define some constant about tab category, these flags can be combine with operator |
|
||||
struct tab_type
|
||||
{
|
||||
@ -75,7 +76,6 @@ namespace detail
|
||||
};
|
||||
};
|
||||
|
||||
class caret;
|
||||
|
||||
/// a window data structure descriptor
|
||||
struct basic_window
|
||||
@ -212,7 +212,9 @@ namespace detail
|
||||
|
||||
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
|
||||
#endif
|
||||
container tabstop;
|
||||
std::vector<edge_nimbus_action> effects_edge_nimbus;
|
||||
basic_window* focus{nullptr};
|
||||
|
@ -10,8 +10,8 @@
|
||||
* @file: nana/gui/detail/window_manager.hpp
|
||||
*
|
||||
* <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_handle method just destroys 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
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -449,7 +449,7 @@ namespace std
|
||||
//template< >
|
||||
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');
|
||||
sz = std::strftime(&str[0], str.size() - 1, fmt, tmb);
|
||||
str.resize(sz);
|
||||
|
@ -211,19 +211,24 @@ namespace nana
|
||||
basic_window::other_tag::other_tag(category::flags categ)
|
||||
: category(categ), active_window(nullptr), upd_state(update_state::none)
|
||||
{
|
||||
#ifndef WIDGET_FRAME_DEPRECATED
|
||||
switch(categ)
|
||||
{
|
||||
case category::flags::root:
|
||||
attribute.root = new attr_root_tag;
|
||||
break;
|
||||
#ifndef WIDGET_FRAME_DEPRECATED
|
||||
case category::flags::frame:
|
||||
attribute.frame = new attr_frame_tag;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
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()
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
|
||||
#include <iostream> //debug travis
|
||||
|
||||
namespace nana
|
||||
{
|
||||
|
||||
@ -92,7 +94,9 @@ namespace detail
|
||||
{
|
||||
void operator()(basic_window* wd) const
|
||||
{
|
||||
std::cout << "delete basic_window " << wd <<" category="<<static_cast<int>(wd->other.category)<< std::endl;
|
||||
delete wd;
|
||||
std::cout << " delete successfully" << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -2078,7 +2078,7 @@ namespace nana
|
||||
|
||||
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.
|
||||
|
@ -3451,7 +3451,7 @@ namespace nana{ namespace widgets
|
||||
|
||||
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]);
|
||||
if (graph_.glyph_pixels(ent.begin, len, pxbuf.get()))
|
||||
|
@ -627,7 +627,7 @@ namespace nana
|
||||
std::unique_ptr<unsigned[]> pixels(new unsigned[text.size()]);
|
||||
graph_.glyph_pixels(text.c_str(), text.size(), pixels.get());
|
||||
|
||||
unsigned substr_len = 0;
|
||||
std::size_t substr_len = 0;
|
||||
unsigned substr_px = 0;
|
||||
|
||||
if (align::right == text_align_ex_)
|
||||
|
Loading…
x
Reference in New Issue
Block a user