Skip to content

Commit 5eb220a

Browse files
committed
Merge branch 'develop'
1 parent 7e3178c commit 5eb220a

Some content is hidden

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

71 files changed

+2527
-133
lines changed

CMakeLists.txt

+10-7
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,22 @@ if(CMAKE_CXX_STANDARD LESS 17)
1414
set(CMAKE_CXX_STANDARD 17)
1515
endif()
1616

17-
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
18-
include(GitSubmoduleCheck)
19-
git_submodule_check(lib/artist)
20-
git_submodule_check(lib/external/asio)
21-
git_submodule_check(lib/infra)
22-
endif()
23-
2417
include(ElementsConfigCommon)
2518

2619
option(ELEMENTS_BUILD_EXAMPLES "build Elements library examples" ON)
2720
option(ELEMENTS_ENABLE_LTO "enable link time optimization for Elements targets" OFF)
2821
set(ELEMENTS_HOST_UI_LIBRARY "" CACHE STRING "gtk, cocoa or win32")
2922
option(ELEMENTS_HOST_ONLY_WIN7 "If host UI library is win32, reduce elements features to support Windows 7" OFF)
23+
option(ENABLE_GIT_SUBMODULE_CHECK "Check and clone submodules when not available." ON)
24+
25+
if (ENABLE_GIT_SUBMODULE_CHECK)
26+
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
27+
include(GitSubmoduleCheck)
28+
git_submodule_check(lib/artist)
29+
git_submodule_check(lib/external/asio)
30+
git_submodule_check(lib/infra)
31+
endif()
32+
endif()
3033

3134
add_subdirectory(lib)
3235

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,23 @@ and I very much welcome suggestions and contributions. Hey, this is an open
4040
source project! If you like the design, concepts and ideas behind Elements, I
4141
very much welcome collaboration.
4242

43+
**December 5, 2023:**
44+
The master branch now contains the code base using the Artist library for 2D canvas
45+
drawing (https://github.com/cycfi/artist).
46+
47+
For those who have not been following recently, the Artist 2D Canvas Library is an abstraction layer with an API
48+
inspired by the HTML5 canvas API. The library presents a lean API modeled after the HTML Canvas 2D Context
49+
specification. The API is a not-so-thin layer above various 2D platform-specific and cross-platform 2D
50+
"backend" graphics libraries, such as Skia and Quartz-2D.
51+
52+
The artist library replaces the original cairo based canvas implementation used by elements. The classic
53+
cairo implementation is now in the `cairo_2023` branch. At this point, as long as you are using the examples
54+
as a starting point and usage guide, code cairo_2023 is fully compatible with the artist based code, which
55+
is now in the `master` branch.
56+
4357
## News
4458

59+
- 5 December 2023: See status above regarding the Artist 2D Canvas Library.
4560
- 19 January 2021: Added Child Windows to develop (will merge to master in due time). [See Example](https://bit.ly/3iLMJt2).
4661
- 25 September 2020: Added [thumbwheels](https://github.com/cycfi/elements/issues/231).
4762
- 12 September 2020: Linux [Artist 2D Canvas Library](https://github.com/cycfi/artist)

cmake/ElementsConfigApp.cmake

-19
Original file line numberDiff line numberDiff line change
@@ -129,25 +129,6 @@ elseif (WIN32)
129129
/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup shcore.lib
130130
)
131131

132-
add_dependencies(${PROJECT_NAME} windows_dlls)
133-
134-
if (CMAKE_SIZEOF_VOID_P EQUAL 8) # 64 bits?
135-
set(FREETYPE_DLL ${ELEMENTS_ROOT}/lib/external/freetype/win64/freetype.dll)
136-
set(FONTCONFIG_DLL ${ELEMENTS_ROOT}/lib/external/fontconfig/x64/fontconfig.dll)
137-
set(ICONV_DLL ${ELEMENTS_ROOT}/lib/external/fontconfig/x64/libiconv.dll)
138-
set(XML2 ${ELEMENTS_ROOT}/lib/external/fontconfig/x64/libxml2.dll)
139-
else()
140-
set(FREETYPE_DLL ${ELEMENTS_ROOT}/lib/external/freetype/win32/freetype.dll)
141-
set(FONTCONFIG_DLL ${ELEMENTS_ROOT}/lib/external/fontconfig/x86/fontconfig.dll)
142-
set(ICONV_DLL ${ELEMENTS_ROOT}/lib/external/fontconfig/x86/libiconv.dll)
143-
set(XML2 ${ELEMENTS_ROOT}/lib/external/fontconfig/x86/libxml2.dll)
144-
endif()
145-
146-
file(COPY ${FREETYPE_DLL} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
147-
file(COPY ${FONTCONFIG_DLL} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
148-
file(COPY ${ICONV_DLL} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
149-
file(COPY ${XML2} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
150-
151132
set_property(
152133
TARGET ${ELEMENTS_APP_PROJECT}
153134
PROPERTY

examples/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ add_subdirectory(sync_scrollbars)
2424
add_subdirectory(icons_list)
2525
add_subdirectory(table_list)
2626
add_subdirectory(drop_file)
27+
add_subdirectory(range_slider)
28+
add_subdirectory(model)

examples/basic_sliders_and_knobs/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ auto make_markers()
2424
{
2525
auto track = basic_track<5, is_vertical>();
2626
return slider_labels<10>(
27-
slider_marks<40>(track), // Track with marks
27+
slider_marks_lin<40>(track), // Track with marks
2828
0.8, // Label font size (relative size)
2929
"0", "1", "2", "3", "4", // Labels
3030
"5", "6", "7", "8", "9", "10"

examples/buttons/main.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ auto make_buttons(view& view_)
115115
.body_color(bgreen)
116116
);
117117

118-
auto slide_btn1 = slide_button();
119-
auto slide_btn2 = slide_button();
118+
auto slide_btn1 = slide_switch();
119+
auto slide_btn2 = slide_switch();
120120

121121
slide_btn1.value(true);
122122
slide_btn2.enable(false); // Disable

examples/icons_list/main.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ int main(int argc, char* argv[])
128128
comp.push_back(make_icon_label("menu", icons::menu));
129129
comp.push_back(make_icon_label("link", icons::link));
130130
comp.push_back(make_icon_label("unlink", icons::unlink));
131+
comp.push_back(make_icon_label("folder_open", icons::folder_empty));
132+
comp.push_back(make_icon_label("folder_open_empty", icons::folder_open_empty));
131133
view_.content(
132134
margin({10, 10, 10, 10},
133135
vscroller(margin({40, 20, 40, 20}, comp))),

examples/model/CMakeLists.txt

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
cmake_minimum_required(VERSION 3.9.6...3.15.0)
2+
project(EmptyStarter LANGUAGES C CXX)
3+
4+
if (NOT ELEMENTS_ROOT)
5+
message(FATAL_ERROR "ELEMENTS_ROOT is not set")
6+
endif()
7+
8+
# Make sure ELEMENTS_ROOT is an absolute path to add to the CMake module path
9+
get_filename_component(ELEMENTS_ROOT "${ELEMENTS_ROOT}" ABSOLUTE)
10+
set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${ELEMENTS_ROOT}/cmake")
11+
12+
# If we are building outside the project, you need to set ELEMENTS_ROOT:
13+
if (NOT ELEMENTS_BUILD_EXAMPLES)
14+
include(ElementsConfigCommon)
15+
set(ELEMENTS_BUILD_EXAMPLES OFF)
16+
add_subdirectory(${ELEMENTS_ROOT} elements)
17+
endif()
18+
19+
set(ELEMENTS_APP_PROJECT "Model")
20+
set(ELEMENTS_APP_TITLE "Model")
21+
set(ELEMENTS_APP_COPYRIGHT "Copyright (c) 2016-2023 Joel de Guzman")
22+
set(ELEMENTS_APP_ID "com.cycfi.model")
23+
set(ELEMENTS_APP_VERSION "1.0")
24+
25+
set(ELEMENTS_APP_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
26+
27+
# For your custom application icon on macOS or Windows see cmake/AppIcon.cmake module
28+
include(AppIcon)
29+
include(ElementsConfigApp)

0 commit comments

Comments
 (0)