Blender V5.3
filelist_readjob.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2007 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#pragma once
12
13#include <atomic>
14#include <functional>
15#include <optional>
16#include <string>
17
18#include "AS_remote_library.hh"
19
20#include "BLI_map.hh"
21#include "BLI_mutex.hh"
22
23#include "BKE_report.hh"
24
25namespace blender {
26
27struct BLODataBlockInfo;
28struct FileList;
30struct Main;
31struct wmWindowManager;
32namespace asset_system {
33class AssetLibrary;
34}
35
38 std::string dirpath;
39
41 std::atomic<bool> cancel = false;
42
45 std::atomic<bool> is_downloading = false;
46
50 std::optional<asset_system::RemoteLibraryLoadingStatus::FileSystemTimePoint> request_time =
51 std::nullopt;
52
53 std::atomic<bool> metafiles_in_place = false;
55 std::atomic<bool> new_pages_available = false;
56};
57
60 char main_filepath[1024 /*FILE_MAX*/] = "";
61 Main *current_main = nullptr;
62 wmWindowManager *wm = nullptr;
63 FileList *filelist = nullptr;
64
66
74 char cur_relbase[1024 + 258 /*FILE_MAX_LIBEXTRA*/] = "";
75
83 bool only_main_data = false;
84
87 std::atomic<bool> reload_asset_library = false;
88
90
91 std::optional<std::function<void(asset_system::AssetRepresentation &)>> on_asset_added =
92 std::nullopt;
93
105};
106
107char *current_relpath_append(const FileListReadJob *job_params, const char *filename);
108
110 char /*dirpath*/[1024 + 258 /*FILE_MAX_LIBEXTRA*/],
111 const bool /*do_change*/);
112
114 ListBaseT<FileListInternEntry> *from_entries,
115 int from_entries_num);
116
122 FileListReadJob *job_params,
123 ListBaseT<FileListInternEntry> *entries,
124 BLODataBlockInfo *datablock_info,
125 const bool prefix_relpath_with_group_name,
126 const int idcode,
127 const char *group_name,
128 const std::optional<asset_system::OnlineAssetInfo> online_asset_info = std::nullopt);
129
130void filelist_readjob_recursive_dir_add_items(const bool do_lib,
131 FileListReadJob *job_params,
132 const bool *stop,
133 bool *do_update,
134 float *progress);
135void filelist_readjob_directories_and_libraries(const bool do_lib,
136 FileListReadJob *job_params,
137 const bool *stop,
138 bool *do_update,
139 float *progress);
140
142 bool *stop,
143 bool *do_update,
144 float *progress);
145
147 bool * /*stop*/,
148 bool *do_update,
149 float * /*progress*/);
150
151void filelist_readjob_load_asset_library_data(FileListReadJob *job_params, bool *do_update);
152
156 RemoteLibraryRequest &request,
157 bool *stop,
158 bool *do_update,
159 float *progress);
161
162} // namespace blender
std::chrono::time_point< std::chrono::steady_clock > TimePoint
std::string filename(const std::string_view &str, size_t pos)
BMesh Iterators.
void filelist_readjob_main_assets_add_items(FileListReadJob *job_params, bool *, bool *do_update, float *)
void remote_asset_library_request(FileListReadJob *job_params, const asset_system::RemoteLibraryDefinitionRef &library)
void remote_asset_library_load(FileListReadJob *job_params, RemoteLibraryRequest &request, bool *stop, bool *do_update, float *progress)
char * current_relpath_append(const FileListReadJob *job_params, const char *filename)
bool filelist_checkdir_return_always_valid(const FileList *, char[1024+258], const bool)
void filelist_readjob_load_asset_library_data(FileListReadJob *job_params, bool *do_update)
void filelist_readjob_dir(FileListReadJob *job_params, bool *stop, bool *do_update, float *progress)
void filelist_readjob_list_lib_add_datablock(FileListReadJob *job_params, ListBaseT< FileListInternEntry > *entries, BLODataBlockInfo *datablock_info, const bool prefix_relpath_with_group_name, const int idcode, const char *group_name, const std::optional< asset_system::OnlineAssetInfo > online_asset_info=std::nullopt)
void filelist_timer_step_remote_asset_library(FileListReadJob *job_params)
std::mutex Mutex
Definition BLI_mutex.hh:51
void filelist_readjob_recursive_dir_add_items(const bool do_lib, FileListReadJob *job_params, const bool *stop, bool *do_update, float *progress)
void filelist_readjob_directories_and_libraries(const bool do_lib, FileListReadJob *job_params, const bool *stop, bool *do_update, float *progress)
bool filelist_readjob_append_entries(FileListReadJob *job_params, ListBaseT< FileListInternEntry > *from_entries, int from_entries_num)
std::atomic< bool > reload_asset_library
asset_system::AssetLibrary * load_asset_library
std::optional< std::function< void(asset_system::AssetRepresentation &)> > on_asset_added
Map< std::string, std::unique_ptr< RemoteLibraryRequest > > remote_library_requests
std::atomic< bool > metafiles_in_place
std::atomic< bool > is_downloading
asset_system::RemoteLibraryLoadingStatus::TimePoint last_new_pages_time
std::optional< asset_system::RemoteLibraryLoadingStatus::FileSystemTimePoint > request_time
std::atomic< bool > new_pages_available