Compare commits
	
		
			9 Commits
		
	
	
		
			dev-c887fd
			...
			dev-07070d
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 06d7148408 | |||
| 33875cb58b | |||
| 07070dd2d4 | |||
| c3a7d1521a | |||
| fc994ab758 | |||
| 605a730b59 | |||
| 3e15798afc | |||
| cf697622cb | |||
| 05b0a2f514 | 
							
								
								
									
										8
									
								
								.github/workflows/cd.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.github/workflows/cd.yml
									
									
									
									
										vendored
									
									
								
							@@ -68,7 +68,7 @@ jobs:
 | 
			
		||||
        submodules: recursive
 | 
			
		||||
 | 
			
		||||
    - name: Install Dependencies
 | 
			
		||||
      run: vcpkg install libsodium:x64-windows-static pthreads:x64-windows-static
 | 
			
		||||
      run: vcpkg install libsodium:x64-windows-static pthreads:x64-windows-static pkgconf:x64-windows
 | 
			
		||||
 | 
			
		||||
    # setup vs env
 | 
			
		||||
    - uses: ilammy/msvc-dev-cmd@v1
 | 
			
		||||
@@ -79,7 +79,7 @@ jobs:
 | 
			
		||||
    #- uses: ilammy/setup-nasm@v1
 | 
			
		||||
 | 
			
		||||
    - name: Configure CMake
 | 
			
		||||
      run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DSDL3IMAGE_VENDORED=ON -DSDL3IMAGE_DEPS_SHARED=ON -DSDL3IMAGE_JXL=OFF -DSDL3IMAGE_AVIF=OFF
 | 
			
		||||
      run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DSDL3IMAGE_VENDORED=ON -DSDL3IMAGE_DEPS_SHARED=ON -DSDL3IMAGE_JXL=OFF -DSDL3IMAGE_AVIF=OFF -DPKG_CONFIG_EXECUTABLE=C:/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe
 | 
			
		||||
 | 
			
		||||
    - name: Build
 | 
			
		||||
      run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
 | 
			
		||||
@@ -122,7 +122,7 @@ jobs:
 | 
			
		||||
        submodules: recursive
 | 
			
		||||
 | 
			
		||||
    - name: Install Dependencies
 | 
			
		||||
      run: vcpkg install libsodium:x64-windows-static pthreads:x64-windows-static
 | 
			
		||||
      run: vcpkg install libsodium:x64-windows-static pthreads:x64-windows-static pkgconf:x64-windows
 | 
			
		||||
 | 
			
		||||
    # setup vs env
 | 
			
		||||
    - uses: ilammy/msvc-dev-cmd@v1
 | 
			
		||||
@@ -133,7 +133,7 @@ jobs:
 | 
			
		||||
    #- uses: ilammy/setup-nasm@v1
 | 
			
		||||
 | 
			
		||||
    - name: Configure CMake
 | 
			
		||||
      run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DTOMATO_ASAN=ON -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DSDL3IMAGE_VENDORED=ON -DSDL3IMAGE_DEPS_SHARED=ON -DSDL3IMAGE_JXL=OFF -DSDL3IMAGE_AVIF=OFF
 | 
			
		||||
      run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DTOMATO_ASAN=ON -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DSDL3IMAGE_VENDORED=ON -DSDL3IMAGE_DEPS_SHARED=ON -DSDL3IMAGE_JXL=OFF -DSDL3IMAGE_AVIF=OFF -DPKG_CONFIG_EXECUTABLE=C:/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe
 | 
			
		||||
 | 
			
		||||
    - name: Build
 | 
			
		||||
      run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							@@ -59,7 +59,7 @@ jobs:
 | 
			
		||||
        submodules: recursive
 | 
			
		||||
 | 
			
		||||
    - name: Install Dependencies
 | 
			
		||||
      run: vcpkg install libsodium:x64-windows-static pthreads:x64-windows-static
 | 
			
		||||
      run: vcpkg install libsodium:x64-windows-static pthreads:x64-windows-static pkgconf:x64-windows
 | 
			
		||||
 | 
			
		||||
    # setup vs env
 | 
			
		||||
    - uses: ilammy/msvc-dev-cmd@v1
 | 
			
		||||
@@ -70,7 +70,7 @@ jobs:
 | 
			
		||||
    #- uses: ilammy/setup-nasm@v1
 | 
			
		||||
 | 
			
		||||
    - name: Configure CMake
 | 
			
		||||
      run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DSDL3IMAGE_VENDORED=ON -DSDL3IMAGE_DEPS_SHARED=ON -DSDL3IMAGE_JXL=OFF -DSDL3IMAGE_AVIF=OFF
 | 
			
		||||
      run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DSDL3IMAGE_VENDORED=ON -DSDL3IMAGE_DEPS_SHARED=ON -DSDL3IMAGE_JXL=OFF -DSDL3IMAGE_AVIF=OFF -DPKG_CONFIG_EXECUTABLE=C:/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe
 | 
			
		||||
 | 
			
		||||
    - name: Build
 | 
			
		||||
      run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								external/sdl/CMakeLists.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								external/sdl/CMakeLists.txt
									
									
									
									
										vendored
									
									
								
							@@ -9,7 +9,8 @@ if (NOT TARGET SDL3::SDL3)
 | 
			
		||||
 | 
			
		||||
	FetchContent_Declare(SDL3
 | 
			
		||||
		GIT_REPOSITORY https://github.com/libsdl-org/SDL
 | 
			
		||||
		GIT_TAG 0429f5d6a36fc35b551bcc2acd4a40c2db6dab82 # tip when looking
 | 
			
		||||
		#GIT_TAG 0429f5d6a36fc35b551bcc2acd4a40c2db6dab82 # tip when looking
 | 
			
		||||
		GIT_TAG 14f584a94bfd49cf1524db75bf3c419fdf9436cd # tip 26-04-2024
 | 
			
		||||
		FIND_PACKAGE_ARGS # for the future
 | 
			
		||||
	)
 | 
			
		||||
	FetchContent_MakeAvailable(SDL3)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								external/solanaceae_message_serializer
									
									
									
									
										vendored
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								external/solanaceae_message_serializer
									
									
									
									
										vendored
									
									
								
							 Submodule external/solanaceae_message_serializer updated: 1a3fcc6757...e574c4f779
									
								
							
							
								
								
									
										254
									
								
								external/toxcore/CMakeLists.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										254
									
								
								external/toxcore/CMakeLists.txt
									
									
									
									
										vendored
									
									
								
							@@ -1,214 +1,66 @@
 | 
			
		||||
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
 | 
			
		||||
cmake_minimum_required(VERSION 3.9...3.16 FATAL_ERROR)
 | 
			
		||||
 | 
			
		||||
set(EXPERIMENTAL_API ON CACHE BOOL "" FORCE)
 | 
			
		||||
set(UNITTEST OFF CACHE BOOL "" FORCE)
 | 
			
		||||
set(BOOTSTRAP_DAEMON OFF CACHE BOOL "" FORCE)
 | 
			
		||||
 | 
			
		||||
add_subdirectory(./c-toxcore)
 | 
			
		||||
 | 
			
		||||
# the ideal case
 | 
			
		||||
#add_library(toxcore ALIAS toxcore_static)
 | 
			
		||||
 | 
			
		||||
# the sad case
 | 
			
		||||
add_library(toxcore INTERFACE)
 | 
			
		||||
 | 
			
		||||
if (TARGET toxcore_static)
 | 
			
		||||
	target_link_libraries(toxcore INTERFACE toxcore_static)
 | 
			
		||||
else()
 | 
			
		||||
	target_link_libraries(toxcore INTERFACE toxcore_shared)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# HACK: "install" api headers into binary dir
 | 
			
		||||
configure_file(
 | 
			
		||||
	./c-toxcore/toxcore/tox.h
 | 
			
		||||
	${CMAKE_CURRENT_BINARY_DIR}/include/tox/tox.h
 | 
			
		||||
	@ONLY
 | 
			
		||||
)
 | 
			
		||||
configure_file(
 | 
			
		||||
	./c-toxcore/toxcore/tox_events.h
 | 
			
		||||
	${CMAKE_CURRENT_BINARY_DIR}/include/tox/tox_events.h
 | 
			
		||||
	@ONLY
 | 
			
		||||
)
 | 
			
		||||
configure_file(
 | 
			
		||||
	./c-toxcore/toxcore/tox_private.h
 | 
			
		||||
	${CMAKE_CURRENT_BINARY_DIR}/include/tox/tox_private.h
 | 
			
		||||
	@ONLY
 | 
			
		||||
)
 | 
			
		||||
configure_file(
 | 
			
		||||
	./c-toxcore/toxencryptsave/toxencryptsave.h
 | 
			
		||||
	${CMAKE_CURRENT_BINARY_DIR}/include/tox/toxencryptsave.h
 | 
			
		||||
	@ONLY
 | 
			
		||||
)
 | 
			
		||||
configure_file(
 | 
			
		||||
	./c-toxcore/toxav/toxav.h
 | 
			
		||||
	${CMAKE_CURRENT_BINARY_DIR}/include/tox/toxav.h
 | 
			
		||||
	@ONLY
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
target_include_directories(toxcore INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/include/)
 | 
			
		||||
 | 
			
		||||
# HACK: support old libsodium find
 | 
			
		||||
# libs should handle this case themselfs
 | 
			
		||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
 | 
			
		||||
 | 
			
		||||
set(TOX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/c-toxcore/")
 | 
			
		||||
 | 
			
		||||
# TODO: shared
 | 
			
		||||
add_library(toxcore STATIC
 | 
			
		||||
	${TOX_DIR}third_party/cmp/cmp.c
 | 
			
		||||
	${TOX_DIR}third_party/cmp/cmp.h
 | 
			
		||||
 | 
			
		||||
	${TOX_DIR}toxcore/announce.c
 | 
			
		||||
	${TOX_DIR}toxcore/announce.h
 | 
			
		||||
	${TOX_DIR}toxcore/bin_pack.c
 | 
			
		||||
	${TOX_DIR}toxcore/bin_pack.h
 | 
			
		||||
	${TOX_DIR}toxcore/bin_unpack.c
 | 
			
		||||
	${TOX_DIR}toxcore/bin_unpack.h
 | 
			
		||||
	${TOX_DIR}toxcore/ccompat.c
 | 
			
		||||
	${TOX_DIR}toxcore/ccompat.h
 | 
			
		||||
	${TOX_DIR}toxcore/crypto_core.c
 | 
			
		||||
	${TOX_DIR}toxcore/crypto_core.h
 | 
			
		||||
	${TOX_DIR}toxcore/crypto_core_pack.c
 | 
			
		||||
	${TOX_DIR}toxcore/crypto_core_pack.h
 | 
			
		||||
	${TOX_DIR}toxcore/DHT.c
 | 
			
		||||
	${TOX_DIR}toxcore/DHT.h
 | 
			
		||||
	${TOX_DIR}toxcore/events/conference_connected.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/conference_invite.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/conference_message.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/conference_peer_list_changed.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/conference_peer_name.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/conference_title.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/dht_get_nodes_response.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/events_alloc.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/events_alloc.h
 | 
			
		||||
	${TOX_DIR}toxcore/events/file_chunk_request.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/file_recv.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/file_recv_chunk.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/file_recv_control.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/friend_connection_status.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/friend_lossless_packet.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/friend_lossy_packet.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/friend_message.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/friend_name.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/friend_read_receipt.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/friend_request.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/friend_status.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/friend_status_message.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/friend_typing.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/self_connection_status.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_custom_packet.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_custom_private_packet.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_invite.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_join_fail.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_message.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_moderation.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_password.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_peer_exit.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_peer_join.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_peer_limit.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_peer_name.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_peer_status.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_privacy_state.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_private_message.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_self_join.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_topic.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_topic_lock.c
 | 
			
		||||
	${TOX_DIR}toxcore/events/group_voice_state.c
 | 
			
		||||
	${TOX_DIR}toxcore/forwarding.c
 | 
			
		||||
	${TOX_DIR}toxcore/forwarding.h
 | 
			
		||||
	${TOX_DIR}toxcore/friend_connection.c
 | 
			
		||||
	${TOX_DIR}toxcore/friend_connection.h
 | 
			
		||||
	${TOX_DIR}toxcore/friend_requests.c
 | 
			
		||||
	${TOX_DIR}toxcore/friend_requests.h
 | 
			
		||||
	${TOX_DIR}toxcore/group.c
 | 
			
		||||
	${TOX_DIR}toxcore/group.h
 | 
			
		||||
	${TOX_DIR}toxcore/group_announce.c
 | 
			
		||||
	${TOX_DIR}toxcore/group_announce.h
 | 
			
		||||
	${TOX_DIR}toxcore/group_moderation.c
 | 
			
		||||
	${TOX_DIR}toxcore/group_moderation.h
 | 
			
		||||
	${TOX_DIR}toxcore/group_chats.c
 | 
			
		||||
	${TOX_DIR}toxcore/group_chats.h
 | 
			
		||||
	${TOX_DIR}toxcore/group_common.h
 | 
			
		||||
	${TOX_DIR}toxcore/group_connection.c
 | 
			
		||||
	${TOX_DIR}toxcore/group_connection.h
 | 
			
		||||
	${TOX_DIR}toxcore/group_onion_announce.c
 | 
			
		||||
	${TOX_DIR}toxcore/group_onion_announce.h
 | 
			
		||||
	${TOX_DIR}toxcore/group_pack.c
 | 
			
		||||
	${TOX_DIR}toxcore/group_pack.h
 | 
			
		||||
	${TOX_DIR}toxcore/LAN_discovery.c
 | 
			
		||||
	${TOX_DIR}toxcore/LAN_discovery.h
 | 
			
		||||
	${TOX_DIR}toxcore/list.c
 | 
			
		||||
	${TOX_DIR}toxcore/list.h
 | 
			
		||||
	${TOX_DIR}toxcore/logger.c
 | 
			
		||||
	${TOX_DIR}toxcore/logger.h
 | 
			
		||||
	${TOX_DIR}toxcore/Messenger.c
 | 
			
		||||
	${TOX_DIR}toxcore/Messenger.h
 | 
			
		||||
	${TOX_DIR}toxcore/mem.c
 | 
			
		||||
	${TOX_DIR}toxcore/mem.h
 | 
			
		||||
	${TOX_DIR}toxcore/mono_time.c
 | 
			
		||||
	${TOX_DIR}toxcore/mono_time.h
 | 
			
		||||
	${TOX_DIR}toxcore/net_crypto.c
 | 
			
		||||
	${TOX_DIR}toxcore/net_crypto.h
 | 
			
		||||
	${TOX_DIR}toxcore/network.c
 | 
			
		||||
	${TOX_DIR}toxcore/network.h
 | 
			
		||||
	${TOX_DIR}toxcore/onion_announce.c
 | 
			
		||||
	${TOX_DIR}toxcore/onion_announce.h
 | 
			
		||||
	${TOX_DIR}toxcore/onion.c
 | 
			
		||||
	${TOX_DIR}toxcore/onion_client.c
 | 
			
		||||
	${TOX_DIR}toxcore/onion_client.h
 | 
			
		||||
	${TOX_DIR}toxcore/onion.h
 | 
			
		||||
	${TOX_DIR}toxcore/ping_array.c
 | 
			
		||||
	${TOX_DIR}toxcore/ping_array.h
 | 
			
		||||
	${TOX_DIR}toxcore/ping.c
 | 
			
		||||
	${TOX_DIR}toxcore/ping.h
 | 
			
		||||
	${TOX_DIR}toxcore/shared_key_cache.c
 | 
			
		||||
	${TOX_DIR}toxcore/shared_key_cache.h
 | 
			
		||||
	${TOX_DIR}toxcore/state.c
 | 
			
		||||
	${TOX_DIR}toxcore/state.h
 | 
			
		||||
	${TOX_DIR}toxcore/TCP_client.c
 | 
			
		||||
	${TOX_DIR}toxcore/TCP_client.h
 | 
			
		||||
	${TOX_DIR}toxcore/TCP_common.c
 | 
			
		||||
	${TOX_DIR}toxcore/TCP_common.h
 | 
			
		||||
	${TOX_DIR}toxcore/TCP_connection.c
 | 
			
		||||
	${TOX_DIR}toxcore/TCP_connection.h
 | 
			
		||||
	${TOX_DIR}toxcore/TCP_server.c
 | 
			
		||||
	${TOX_DIR}toxcore/TCP_server.h
 | 
			
		||||
	${TOX_DIR}toxcore/timed_auth.c
 | 
			
		||||
	${TOX_DIR}toxcore/timed_auth.h
 | 
			
		||||
	${TOX_DIR}toxcore/tox_api.c
 | 
			
		||||
	${TOX_DIR}toxcore/tox.c
 | 
			
		||||
	${TOX_DIR}toxcore/tox_dispatch.c
 | 
			
		||||
	${TOX_DIR}toxcore/tox_dispatch.h
 | 
			
		||||
	${TOX_DIR}toxcore/tox_event.c
 | 
			
		||||
	${TOX_DIR}toxcore/tox_event.h
 | 
			
		||||
	${TOX_DIR}toxcore/tox_events.c
 | 
			
		||||
	${TOX_DIR}toxcore/tox_events.h
 | 
			
		||||
	${TOX_DIR}toxcore/tox.h
 | 
			
		||||
	${TOX_DIR}toxcore/tox_private.c
 | 
			
		||||
	${TOX_DIR}toxcore/tox_private.h
 | 
			
		||||
	${TOX_DIR}toxcore/tox_pack.h
 | 
			
		||||
	${TOX_DIR}toxcore/tox_pack.c
 | 
			
		||||
	${TOX_DIR}toxcore/tox_unpack.c
 | 
			
		||||
	${TOX_DIR}toxcore/tox_unpack.h
 | 
			
		||||
	${TOX_DIR}toxcore/util.c
 | 
			
		||||
	${TOX_DIR}toxcore/util.h
 | 
			
		||||
 | 
			
		||||
	${TOX_DIR}toxencryptsave/defines.h
 | 
			
		||||
	${TOX_DIR}toxencryptsave/toxencryptsave.c
 | 
			
		||||
	${TOX_DIR}toxencryptsave/toxencryptsave.h
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# HACK: "install" api headers into self
 | 
			
		||||
# this is dirty, should be binary dir
 | 
			
		||||
# TODO: add the others
 | 
			
		||||
configure_file(
 | 
			
		||||
	${TOX_DIR}toxcore/tox.h
 | 
			
		||||
	${TOX_DIR}tox/tox.h
 | 
			
		||||
	@ONLY
 | 
			
		||||
)
 | 
			
		||||
configure_file(
 | 
			
		||||
	${TOX_DIR}toxcore/tox_events.h
 | 
			
		||||
	${TOX_DIR}tox/tox_events.h
 | 
			
		||||
	@ONLY
 | 
			
		||||
)
 | 
			
		||||
configure_file(
 | 
			
		||||
	${TOX_DIR}toxcore/tox_private.h
 | 
			
		||||
	${TOX_DIR}tox/tox_private.h
 | 
			
		||||
	@ONLY
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
target_include_directories(toxcore PRIVATE "${TOX_DIR}toxcore")
 | 
			
		||||
target_include_directories(toxcore PUBLIC "${TOX_DIR}")
 | 
			
		||||
 | 
			
		||||
target_compile_definitions(toxcore PUBLIC USE_IPV6=1)
 | 
			
		||||
#target_compile_definitions(toxcore PUBLIC MIN_LOGGER_LEVEL=LOGGER_LEVEL_DEBUG)
 | 
			
		||||
target_compile_definitions(toxcore PUBLIC MIN_LOGGER_LEVEL=LOGGER_LEVEL_INFO)
 | 
			
		||||
 | 
			
		||||
find_package(unofficial-sodium CONFIG QUIET)
 | 
			
		||||
find_package(sodium QUIET)
 | 
			
		||||
if(unofficial-sodium_FOUND) # vcpkg
 | 
			
		||||
	if(TARGET unofficial-sodium::sodium)
 | 
			
		||||
		target_link_libraries(toxcore unofficial-sodium::sodium)
 | 
			
		||||
		target_link_libraries(toxcore INTERFACE unofficial-sodium::sodium)
 | 
			
		||||
	endif()
 | 
			
		||||
	if(TARGET unofficial-sodium::sodium_config_public)
 | 
			
		||||
		target_link_libraries(toxcore unofficial-sodium::sodium_config_public)
 | 
			
		||||
		target_link_libraries(toxcore INTERFACE unofficial-sodium::sodium_config_public)
 | 
			
		||||
	endif()
 | 
			
		||||
elseif(sodium_FOUND)
 | 
			
		||||
	target_link_libraries(toxcore sodium)
 | 
			
		||||
	target_link_libraries(toxcore INTERFACE sodium)
 | 
			
		||||
else()
 | 
			
		||||
	message(SEND_ERROR "missing libsodium")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if(WIN32)
 | 
			
		||||
	target_link_libraries(toxcore ws2_32 iphlpapi)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
find_package(pthreads QUIET)
 | 
			
		||||
if(TARGET PThreads4W::PThreads4W)
 | 
			
		||||
	target_link_libraries(toxcore PThreads4W::PThreads4W)
 | 
			
		||||
else()
 | 
			
		||||
	set(THREADS_PREFER_PTHREAD_FLAG ON)
 | 
			
		||||
	find_package(Threads REQUIRED)
 | 
			
		||||
	target_link_libraries(toxcore Threads::Threads)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
add_executable(DHT_Bootstrap EXCLUDE_FROM_ALL
 | 
			
		||||
	${TOX_DIR}other/DHT_bootstrap.c
 | 
			
		||||
	${TOX_DIR}other/bootstrap_node_packets.h
 | 
			
		||||
	${TOX_DIR}other/bootstrap_node_packets.c
 | 
			
		||||
	${TOX_DIR}testing/misc_tools.h
 | 
			
		||||
	${TOX_DIR}testing/misc_tools.c
 | 
			
		||||
)
 | 
			
		||||
target_link_libraries(DHT_Bootstrap toxcore)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								flake.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										8
									
								
								flake.lock
									
									
									
										generated
									
									
									
								
							@@ -63,17 +63,17 @@
 | 
			
		||||
    "sdl3": {
 | 
			
		||||
      "flake": false,
 | 
			
		||||
      "locked": {
 | 
			
		||||
        "lastModified": 1713196978,
 | 
			
		||||
        "narHash": "sha256-qn6YChphDi2p1GRwAEno6QI1rDNEmly+tElzDJnOcvg=",
 | 
			
		||||
        "lastModified": 1714100414,
 | 
			
		||||
        "narHash": "sha256-eaiVG5WJoLnFvdpYBR+DF+YuMu5C3lA1SKuzN8+hfDM=",
 | 
			
		||||
        "owner": "libsdl-org",
 | 
			
		||||
        "repo": "SDL",
 | 
			
		||||
        "rev": "0429f5d6a36fc35b551bcc2acd4a40c2db6dab82",
 | 
			
		||||
        "rev": "14f584a94bfd49cf1524db75bf3c419fdf9436cd",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      },
 | 
			
		||||
      "original": {
 | 
			
		||||
        "owner": "libsdl-org",
 | 
			
		||||
        "repo": "SDL",
 | 
			
		||||
        "rev": "0429f5d6a36fc35b551bcc2acd4a40c2db6dab82",
 | 
			
		||||
        "rev": "14f584a94bfd49cf1524db75bf3c419fdf9436cd",
 | 
			
		||||
        "type": "github"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@
 | 
			
		||||
      flake = false;
 | 
			
		||||
    };
 | 
			
		||||
    sdl3 = {
 | 
			
		||||
      url = "github:libsdl-org/SDL/0429f5d6a36fc35b551bcc2acd4a40c2db6dab82"; # keep in sync this cmake
 | 
			
		||||
      url = "github:libsdl-org/SDL/14f584a94bfd49cf1524db75bf3c419fdf9436cd"; # keep in sync this cmake
 | 
			
		||||
      flake = false;
 | 
			
		||||
    };
 | 
			
		||||
    sdl3_image = {
 | 
			
		||||
 
 | 
			
		||||
@@ -95,35 +95,33 @@ void renderAvatar(
 | 
			
		||||
	const Contact3Handle c,
 | 
			
		||||
	ImVec2 box
 | 
			
		||||
) {
 | 
			
		||||
	ImVec4 color_current = th.getColor<ThemeCol_Contact::avatar_offline>();
 | 
			
		||||
	if (c.all_of<Contact::Components::ConnectionState>()) {
 | 
			
		||||
		const auto c_state = c.get<Contact::Components::ConnectionState>().state;
 | 
			
		||||
		if (c_state == Contact::Components::ConnectionState::State::direct) {
 | 
			
		||||
			color_current = th.getColor<ThemeCol_Contact::avatar_online_direct>();
 | 
			
		||||
		} else if (c_state == Contact::Components::ConnectionState::State::cloud) {
 | 
			
		||||
			color_current = th.getColor<ThemeCol_Contact::avatar_online_cloud>();
 | 
			
		||||
	// deploy dummy of same size and check visibility
 | 
			
		||||
	const auto orig_curser_pos = ImGui::GetCursorPos();
 | 
			
		||||
	ImGui::Dummy(box);
 | 
			
		||||
	if (ImGui::IsItemVisible()) {
 | 
			
		||||
		ImGui::SetCursorPos(orig_curser_pos); // reset for actual img
 | 
			
		||||
 | 
			
		||||
		ImVec4 color_current = th.getColor<ThemeCol_Contact::avatar_offline>();
 | 
			
		||||
		if (c.all_of<Contact::Components::ConnectionState>()) {
 | 
			
		||||
			const auto c_state = c.get<Contact::Components::ConnectionState>().state;
 | 
			
		||||
			if (c_state == Contact::Components::ConnectionState::State::direct) {
 | 
			
		||||
				color_current = th.getColor<ThemeCol_Contact::avatar_online_direct>();
 | 
			
		||||
			} else if (c_state == Contact::Components::ConnectionState::State::cloud) {
 | 
			
		||||
				color_current = th.getColor<ThemeCol_Contact::avatar_online_cloud>();
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// avatar
 | 
			
		||||
		const auto [id, width, height] = contact_tc.get(c);
 | 
			
		||||
		ImGui::Image(
 | 
			
		||||
			id,
 | 
			
		||||
			box,
 | 
			
		||||
			{0, 0},
 | 
			
		||||
			{1, 1},
 | 
			
		||||
			{1, 1, 1, 1},
 | 
			
		||||
			color_current
 | 
			
		||||
		);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// icon pos
 | 
			
		||||
	auto p0 = ImGui::GetCursorScreenPos();
 | 
			
		||||
	p0.x += box.x * 0.5f;
 | 
			
		||||
	p0.y += box.y * 0.5f;
 | 
			
		||||
	auto p1_o = box;
 | 
			
		||||
	p1_o.x *= 0.5f;
 | 
			
		||||
	p1_o.y *= 0.5f;
 | 
			
		||||
 | 
			
		||||
	// avatar
 | 
			
		||||
	const auto [id, width, height] = contact_tc.get(c);
 | 
			
		||||
	ImGui::Image(
 | 
			
		||||
		id,
 | 
			
		||||
		box,
 | 
			
		||||
		{0, 0},
 | 
			
		||||
		{1, 1},
 | 
			
		||||
		{1, 1, 1, 1},
 | 
			
		||||
		color_current
 | 
			
		||||
	);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool renderContactBig(
 | 
			
		||||
@@ -135,6 +133,7 @@ bool renderContactBig(
 | 
			
		||||
	const bool selectable,
 | 
			
		||||
	const bool selected
 | 
			
		||||
) {
 | 
			
		||||
	ImGui::BeginGroup();
 | 
			
		||||
	if (line_height < 1) {
 | 
			
		||||
		line_height = 1;
 | 
			
		||||
	}
 | 
			
		||||
@@ -187,8 +186,18 @@ bool renderContactBig(
 | 
			
		||||
			ImGui::TextUnformatted("Connection state: unknown");
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// TODO: add a whole bunch more info
 | 
			
		||||
		if (
 | 
			
		||||
			const auto* slt = c.try_get<Contact::Components::StatusText>();
 | 
			
		||||
			slt != nullptr &&
 | 
			
		||||
			!slt->text.empty()
 | 
			
		||||
		) {
 | 
			
		||||
			ImGui::SeparatorText("Status Text");
 | 
			
		||||
			//ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyle().Colors[ImGuiCol_TextDisabled]);
 | 
			
		||||
			ImGui::TextUnformatted(slt->text.c_str());
 | 
			
		||||
			//ImGui::PopStyleColor();
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// TODO: add a whole bunch more info
 | 
			
		||||
		ImGui::EndTooltip();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -205,7 +214,8 @@ bool renderContactBig(
 | 
			
		||||
 | 
			
		||||
	renderAvatar(th, contact_tc, c, {img_y, img_y});
 | 
			
		||||
 | 
			
		||||
	ImGui::SameLine();
 | 
			
		||||
	const float same_line_spacing = ImGui::GetStyle().ItemSpacing.x*0.5f;
 | 
			
		||||
	ImGui::SameLine(0.f, same_line_spacing);
 | 
			
		||||
	ImGui::BeginGroup();
 | 
			
		||||
	{
 | 
			
		||||
		{ // line 1
 | 
			
		||||
@@ -232,7 +242,7 @@ bool renderContactBig(
 | 
			
		||||
					);
 | 
			
		||||
				}
 | 
			
		||||
				ImGui::Dummy(p1_o);
 | 
			
		||||
				ImGui::SameLine(0.f, ImGui::GetStyle().ItemSpacing.x*0.5f);
 | 
			
		||||
				ImGui::SameLine(0.f, same_line_spacing);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			ImGui::Text("%s%s", unread?"* ":"", (c.all_of<Contact::Components::Name>() ? c.get<Contact::Components::Name>().name.c_str() : "<unk>"));
 | 
			
		||||
@@ -269,7 +279,7 @@ bool renderContactBig(
 | 
			
		||||
						);
 | 
			
		||||
					}
 | 
			
		||||
					ImGui::Dummy(p1_o);
 | 
			
		||||
					ImGui::SameLine(0.f, ImGui::GetStyle().ItemSpacing.x*0.5f);
 | 
			
		||||
					ImGui::SameLine(0.f, same_line_spacing);
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				if (
 | 
			
		||||
@@ -283,7 +293,7 @@ bool renderContactBig(
 | 
			
		||||
					ImGui::TextUnformatted(slt->text.c_str(), slt->text.c_str() + slt->first_line_length);
 | 
			
		||||
					ImGui::PopStyleColor();
 | 
			
		||||
				} else {
 | 
			
		||||
					ImGui::TextDisabled(""); // or dummy?
 | 
			
		||||
					ImGui::TextDisabled(" "); // or dummy?
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
@@ -298,6 +308,7 @@ bool renderContactBig(
 | 
			
		||||
 | 
			
		||||
	ImGui::SetCursorPos(post_curser_pos);
 | 
			
		||||
 | 
			
		||||
	ImGui::EndGroup();
 | 
			
		||||
	return got_selected;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -17,6 +17,13 @@ enum class ThemeCol_Contact {
 | 
			
		||||
	icon_backdrop,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void renderAvatar(
 | 
			
		||||
	const Theme& th,
 | 
			
		||||
	ContactTextureCache& contact_tc,
 | 
			
		||||
	const Contact3Handle c,
 | 
			
		||||
	ImVec2 box
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
// returns true if clicked, if selectable, will highlight on hover and respect selected
 | 
			
		||||
// TODO: refine
 | 
			
		||||
// +------+
 | 
			
		||||
 
 | 
			
		||||
@@ -227,7 +227,7 @@ float ChatGui4::render(float time_delta) {
 | 
			
		||||
 | 
			
		||||
				if (sub_contacts != nullptr && !_cr.all_of<Contact::Components::TagPrivate>(*_selected_contact) && _cr.all_of<Contact::Components::TagGroup>(*_selected_contact)) {
 | 
			
		||||
					if (!sub_contacts->empty()) {
 | 
			
		||||
						if (ImGui::BeginChild("subcontacts", {175, -100}, true)) {
 | 
			
		||||
						if (ImGui::BeginChild("subcontacts", {TEXT_BASE_WIDTH * 18.f, -100.f}, true)) {
 | 
			
		||||
							ImGui::Text("subs: %zu", sub_contacts->size());
 | 
			
		||||
							ImGui::Separator();
 | 
			
		||||
							for (const auto& c : *sub_contacts) {
 | 
			
		||||
@@ -298,7 +298,7 @@ float ChatGui4::render(float time_delta) {
 | 
			
		||||
						ImGuiTableFlags_SizingFixedFit
 | 
			
		||||
					;
 | 
			
		||||
					if (msg_reg_ptr != nullptr && ImGui::BeginTable("chat_table", 5, table_flags)) {
 | 
			
		||||
						ImGui::TableSetupColumn("name", 0, TEXT_BASE_WIDTH * 15.f);
 | 
			
		||||
						ImGui::TableSetupColumn("name", 0, TEXT_BASE_WIDTH * 16.f);
 | 
			
		||||
						ImGui::TableSetupColumn("message", ImGuiTableColumnFlags_WidthStretch);
 | 
			
		||||
						ImGui::TableSetupColumn("delivered/read");
 | 
			
		||||
						ImGui::TableSetupColumn("timestamp");
 | 
			
		||||
@@ -386,6 +386,10 @@ float ChatGui4::render(float time_delta) {
 | 
			
		||||
 | 
			
		||||
							// name
 | 
			
		||||
							if (ImGui::TableNextColumn()) {
 | 
			
		||||
								const float img_y {TEXT_BASE_HEIGHT - ImGui::GetStyle().FramePadding.y*2};
 | 
			
		||||
								renderAvatar(_theme, _contact_tc, {_cr, c_from.c}, {img_y, img_y});
 | 
			
		||||
								ImGui::SameLine(0.f, ImGui::GetStyle().ItemSpacing.x*0.5f);
 | 
			
		||||
 | 
			
		||||
								if (_cr.all_of<Contact::Components::Name>(c_from.c)) {
 | 
			
		||||
									ImGui::TextUnformatted(_cr.get<Contact::Components::Name>(c_from.c).name.c_str());
 | 
			
		||||
								} else {
 | 
			
		||||
 
 | 
			
		||||
@@ -187,7 +187,8 @@ std::optional<TextureEntry> ToxAvatarLoader::load(TextureUploaderI& tu, Contact3
 | 
			
		||||
	if (!_cr.any_of<
 | 
			
		||||
		Contact::Components::ToxFriendPersistent,
 | 
			
		||||
		Contact::Components::ToxGroupPersistent,
 | 
			
		||||
		Contact::Components::ToxGroupPeerPersistent
 | 
			
		||||
		Contact::Components::ToxGroupPeerPersistent,
 | 
			
		||||
		Contact::Components::ID
 | 
			
		||||
	>(c)) {
 | 
			
		||||
		return std::nullopt;
 | 
			
		||||
	}
 | 
			
		||||
@@ -199,6 +200,12 @@ std::optional<TextureEntry> ToxAvatarLoader::load(TextureUploaderI& tu, Contact3
 | 
			
		||||
		pixels = generateToxIdenticon(_cr.get<Contact::Components::ToxGroupPersistent>(c).chat_id);
 | 
			
		||||
	} else if (_cr.all_of<Contact::Components::ToxGroupPeerPersistent>(c)) {
 | 
			
		||||
		pixels = generateToxIdenticon(_cr.get<Contact::Components::ToxGroupPeerPersistent>(c).peer_key);
 | 
			
		||||
	} else if (_cr.all_of<Contact::Components::ID>(c)) {
 | 
			
		||||
		// TODO: should we really use toxidenticons for other protocols?
 | 
			
		||||
		// (this is required for self)
 | 
			
		||||
		auto id_copy = _cr.get<Contact::Components::ID>(c).data;
 | 
			
		||||
		id_copy.resize(32);
 | 
			
		||||
		pixels = generateToxIdenticon(id_copy);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	TextureEntry new_entry;
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
// meh, change this
 | 
			
		||||
#include <exception>
 | 
			
		||||
#include <system_error>
 | 
			
		||||
#include <toxencryptsave/toxencryptsave.h>
 | 
			
		||||
#include <tox/toxencryptsave.h>
 | 
			
		||||
 | 
			
		||||
#include <sodium.h>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user