1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
|
/* foundry-context.h
*
* Copyright 2024 Christian Hergert <chergert@redhat.com>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#pragma once
#include <glib-object.h>
#include <libdex.h>
#include "libfoundry-config.h"
#include "foundry-types.h"
#include "foundry-version-macros.h"
G_BEGIN_DECLS
#define FOUNDRY_CONTEXT_ERROR (foundry_context_error_quark())
#define FOUNDRY_TYPE_CONTEXT (foundry_context_get_type())
#define FOUNDRY_TYPE_CONTEXT_FLAGS (foundry_context_flags_get_type())
typedef enum _FoundryContextFlags
{
FOUNDRY_CONTEXT_FLAGS_NONE = 0,
FOUNDRY_CONTEXT_FLAGS_CREATE = 1 << 0,
FOUNDRY_CONTEXT_FLAGS_SHARED = 1 << 1,
} FoundryContextFlags;
typedef enum _FoundryContextError
{
FOUNDRY_CONTEXT_ERROR_IN_SHUTDOWN = 1,
} FoundryContextError;
FOUNDRY_AVAILABLE_IN_ALL
G_DECLARE_FINAL_TYPE (FoundryContext, foundry_context, FOUNDRY, CONTEXT, GObject)
FOUNDRY_AVAILABLE_IN_ALL
GQuark foundry_context_error_quark (void) G_GNUC_CONST;
FOUNDRY_AVAILABLE_IN_ALL
GType foundry_context_flags_get_type (void) G_GNUC_CONST;
FOUNDRY_AVAILABLE_IN_ALL
DexFuture *foundry_context_discover (const char *path,
DexCancellable *cancellable) G_GNUC_WARN_UNUSED_RESULT;
FOUNDRY_AVAILABLE_IN_ALL
DexFuture *foundry_context_new (const char *foundry_dir,
const char *project_dir,
FoundryContextFlags flags,
DexCancellable *cancellable) G_GNUC_WARN_UNUSED_RESULT;
FOUNDRY_AVAILABLE_IN_ALL
DexFuture *foundry_context_new_for_user (DexCancellable *cancellable) G_GNUC_WARN_UNUSED_RESULT;
FOUNDRY_AVAILABLE_IN_ALL
DexFuture *foundry_context_save (FoundryContext *self,
DexCancellable *cancellable) G_GNUC_WARN_UNUSED_RESULT;
FOUNDRY_AVAILABLE_IN_ALL
GFile *foundry_context_dup_state_directory (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
GFile *foundry_context_dup_project_directory (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
DexFuture *foundry_context_shutdown (FoundryContext *self) G_GNUC_WARN_UNUSED_RESULT;
FOUNDRY_AVAILABLE_IN_ALL
gboolean foundry_context_network_allowed (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
void foundry_context_log (FoundryContext *self,
const char *domain,
GLogLevelFlags severity,
const char *format,
...) G_GNUC_PRINTF(4, 5);
FOUNDRY_AVAILABLE_IN_ALL
void foundry_context_logv (FoundryContext *self,
const char *domain,
GLogLevelFlags severity,
const char *format,
va_list args);
FOUNDRY_AVAILABLE_IN_ALL
gboolean foundry_context_is_shared (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
char *foundry_context_dup_build_system (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryBuildManager *foundry_context_dup_build_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryCommandManager *foundry_context_dup_command_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryConfigManager *foundry_context_dup_config_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryDependencyManager *foundry_context_dup_dependency_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryDeviceManager *foundry_context_dup_device_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryDiagnosticManager *foundry_context_dup_diagnostic_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_1_1
FoundryDoapService *foundry_context_dup_doap_service (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryFileManager *foundry_context_dup_file_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryIntentManager *foundry_context_dup_intent_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryRunManager *foundry_context_dup_run_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundrySdkManager *foundry_context_dup_sdk_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_1_1
FoundrySecretService *foundry_context_dup_secret_service (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundrySearchManager *foundry_context_dup_search_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryTestManager *foundry_context_dup_test_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryDBusService *foundry_context_dup_dbus_service (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryLogManager *foundry_context_dup_log_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryOperationManager *foundry_context_dup_operation_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundryTweakManager *foundry_context_dup_tweak_manager (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
gpointer foundry_context_dup_service_typed (FoundryContext *self,
GType service_type);
FOUNDRY_AVAILABLE_IN_ALL
GListModel *foundry_context_list_services (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
GActionGroup *foundry_context_dup_action_group (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
FoundrySettings *foundry_context_load_settings (FoundryContext *self,
const char *schema_id,
const char *schema_path);
FOUNDRY_AVAILABLE_IN_ALL
FoundrySettings *foundry_context_load_project_settings (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
char *foundry_context_cache_filename (FoundryContext *self,
...) G_GNUC_NULL_TERMINATED;
FOUNDRY_AVAILABLE_IN_ALL
GFile *foundry_context_cache_file (FoundryContext *self,
...) G_GNUC_NULL_TERMINATED;
FOUNDRY_AVAILABLE_IN_1_1
char *foundry_context_tmp_filename (FoundryContext *self,
...) G_GNUC_NULL_TERMINATED;
FOUNDRY_AVAILABLE_IN_ALL
char *foundry_context_dup_title (FoundryContext *self);
FOUNDRY_AVAILABLE_IN_ALL
void foundry_context_set_title (FoundryContext *self,
const char *title);
FOUNDRY_AVAILABLE_IN_ALL
FoundryLicense *foundry_context_dup_default_license (FoundryContext *self);
#ifdef FOUNDRY_FEATURE_DEBUGGER
FOUNDRY_AVAILABLE_IN_ALL
FoundryDebuggerManager *foundry_context_dup_debugger_manager (FoundryContext *self);
#endif
#ifdef FOUNDRY_FEATURE_DOCS
FOUNDRY_AVAILABLE_IN_ALL
FoundryDocumentationManager *foundry_context_dup_documentation_manager (FoundryContext *self);
#endif
#ifdef FOUNDRY_FEATURE_FORGE
FOUNDRY_AVAILABLE_IN_1_1
FoundryForgeManager *foundry_context_dup_forge_manager (FoundryContext *self);
#endif
#ifdef FOUNDRY_FEATURE_LLM
FOUNDRY_AVAILABLE_IN_ALL
FoundryLlmManager *foundry_context_dup_llm_manager (FoundryContext *self);
#endif
#ifdef FOUNDRY_FEATURE_LSP
FOUNDRY_AVAILABLE_IN_ALL
FoundryLspManager *foundry_context_dup_lsp_manager (FoundryContext *self);
#endif
#ifdef FOUNDRY_FEATURE_TERMINAL
FOUNDRY_AVAILABLE_IN_1_1
FoundryTerminalService *foundry_context_dup_terminal_service (FoundryContext *self);
#endif
#ifdef FOUNDRY_FEATURE_TEXT
FOUNDRY_AVAILABLE_IN_ALL
FoundryTextManager *foundry_context_dup_text_manager (FoundryContext *self);
#endif
#ifdef FOUNDRY_FEATURE_VCS
FOUNDRY_AVAILABLE_IN_ALL
FoundryVcsManager *foundry_context_dup_vcs_manager (FoundryContext *self);
#endif
#define FOUNDRY_DEBUG(context, format, ...) \
foundry_context_log((context), G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, __VA_ARGS__)
#define FOUNDRY_MESSAGE(context, format, ...) \
foundry_context_log((context), G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, __VA_ARGS__)
#define FOUNDRY_INFO(context, format, ...) \
foundry_context_log((context), G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format, __VA_ARGS__)
#define FOUNDRY_WARNING(context, format, ...) \
foundry_context_log((context), G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, format, __VA_ARGS__)
G_END_DECLS
|