Use forward declarations

This commit is contained in:
blankie 2023-02-22 16:33:36 +07:00
parent c7fe85413a
commit 361689a945
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
14 changed files with 20 additions and 17 deletions

1
arb.h
View File

@ -1,7 +1,6 @@
#pragma once
#include <atomic>
#include "logcat_thread.h"
#define ARB_MAX_SIZE 255

View File

@ -1,8 +1,8 @@
#pragma once
#include <imgui/imgui.h>
struct ImFont; // forward declaration from imgui/imgui.h
#include "config.h"
#include "logcat_thread.h"
struct Config; // forward declaration from config.h
class LogcatThread; // forward declaration from logcat_thread.h
void event_loop(ImFont* monospace_font, Config& active_config, LogcatThread& logcat_thread);

View File

@ -1,7 +1,7 @@
#pragma once
#include <vector>
#include "../config.h"
struct Config; // forward declaration from ../config.h
#include "../filters.h"
void filters_fragment(Config& active_config, Filters& __restrict active_filters, Filters& __restrict inactive_filters,

View File

@ -1,6 +1,6 @@
#pragma once
#include <imgui/imgui.h>
struct ImVec2; // forward declaration from imgui/imgui.h
// The following code is slightly modified public domain code from https://github.com/thedmd
// All modifications have an inline comment with "[CUSTOM]"

View File

@ -3,6 +3,7 @@
#include <thread>
#include <variant>
#include "arb.h"
#include "log.h"
#include "logcat_entry.h"
typedef std::variant<LogEntry, LogcatEntry> LogcatThreadItem;

3
misc.h
View File

@ -1,7 +1,8 @@
#pragma once
#include <string>
#include <imgui/imgui.h>
typedef int ImGuiWindowFlags; // forward declaration from imgui/imgui.h
typedef int ImGuiKeyChord; // forward declaration from imgui/imgui.h
std::string quote(const std::string& str);
void throw_system_error(int err, const char* what);

View File

@ -1,6 +1,7 @@
#pragma once
#include "log.h"
#include <string>
void log(std::string message); // forward declaration from log.h
#define IM_ASSERT_USER_ERROR(expr,msg) do { if (!(expr)) { log(msg); } } while (0);
#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS

View File

@ -1,5 +1,5 @@
#pragma once
#include "../logcat_thread.h"
class LogcatThread; // forward declaration from ../logcat_thread.h
void debug_window(LogcatThread& logcat_thread);

View File

@ -2,8 +2,8 @@
#include <vector>
struct Config; // forward declaration from ../config.h
#include "../logcat_entry.h"
#include "../config.h"
void exclusions_window(Config& __restrict active_config, Config& __restrict inactive_config,
const std::vector<LogcatEntry>& logcat_entries, std::vector<size_t>& filtered_logcat_entry_offsets,

View File

@ -2,8 +2,8 @@
#include <vector>
struct Config; // forward declaration from ../config.h
#include "../logcat_entry.h"
#include "../config.h"
void filters_window(Config& __restrict active_config, Config& __restrict inactive_config,
const std::vector<LogcatEntry>& logcat_entries, std::vector<size_t>& filtered_logcat_entry_offsets,

View File

@ -1,5 +1,5 @@
#pragma once
#include <imgui/imgui.h>
struct ImFont; // forward declaration from imgui/imgui.h
void logs_window(ImFont* monospace_font, bool* __restrict autoscrolling, bool* __restrict p_open);

View File

@ -4,6 +4,7 @@
#include <vector>
#include "../misc.h"
#include "../config.h"
#include "../logcat_entry.h"
#include "../logcat_thread.h"
#include "main.h"
@ -113,7 +114,7 @@ void main_window(bool latest_log_entries_read, ImFont* monospace_font, LogcatThr
ImGui::SetNextWindowPos(ImGui::GetMainViewport()->WorkPos);
ImGui::SetNextWindowSize(ImGui::GetMainViewport()->WorkSize);
if (!ImGui::BeginWithCloseShortcut("LogMeow", nullptr,
if (!ImGui::Begin("LogMeow", nullptr,
ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoBringToFrontOnFocus)) {
ImGui::End();
return;

View File

@ -1,11 +1,11 @@
#pragma once
#include <imgui/imgui.h>
struct ImFont; // forward declaration from imgui/imgui.h
#include <vector>
#include "../config.h"
struct Config; // forward declaration from ../config.h
class LogcatThread; // forward declaration from ../logcat_thread.h
#include "../logcat_entry.h"
#include "../logcat_thread.h"
void main_window(bool latest_log_entries_read, ImFont* monospace_font, LogcatThread& logcat_thread,
std::vector<LogcatEntry>& logcat_entries, std::vector<size_t>& filtered_logcat_entry_offsets,

View File

@ -1,5 +1,5 @@
#pragma once
#include "../config.h"
struct Config; // forward declaration from ../config.h
void settings_window(Config& __restrict active_config, Config& __restrict inactive_config, bool* p_open);