Top | ![]() |
![]() |
![]() |
![]() |
IdeContext * | ide_context_new () |
gboolean | ide_context_has_project () |
gpointer | ide_context_peek_child_typed () |
gchar * | ide_context_dup_project_id () |
void | ide_context_set_project_id () |
gchar * | ide_context_dup_title () |
void | ide_context_set_title () |
GFile * | ide_context_ref_workdir () |
void | ide_context_set_workdir () |
GFile * | ide_context_build_file () |
gchar * | ide_context_build_filename () |
GFile * | ide_context_cache_file () |
gchar * | ide_context_cache_filename () |
GSettings * | ide_context_ref_project_settings () |
IdeContext * | ide_object_ref_context () |
IdeContext * | ide_object_get_context () |
void | ide_object_set_context () |
void | ide_context_log () |
#define | ide_context_warning() |
The IdeContext object is the root object for a project. Everything in a project is contained by this object.
IdeContext *
ide_context_new (void
);
Creates a new IdeContext.
This only creates the context object. After creating the object you need
to set a number of properties and then initialize asynchronously using
g_async_initable_init_async()
.
Since: 3.32
gboolean
ide_context_has_project (IdeContext *self
);
Checks to see if a project has been loaded in context
.
Since: 3.32
gpointer ide_context_peek_child_typed (IdeContext *self
,GType type
);
Looks for the first child matching type
, and returns it. No reference is
taken to the child, so you should avoid using this except as used by
compatability functions.
This may only be called from the main thread or you risk the objects being finalized before your caller has a chance to reference them.
an IdeObject that
matches type
if successful; otherwise NULL
.
[transfer none][type IdeObject][nullable]
Since: 3.32
gchar *
ide_context_dup_project_id (IdeContext *self
);
Copies the project-id and returns it to the caller.
Since: 3.32
void ide_context_set_project_id (IdeContext *self
,const gchar *project_id
);
Sets the project-id for the context.
Generally, this should only be done once after loading a project.
Since: 3.32
void ide_context_set_title (IdeContext *self
,const gchar *title
);
Sets the “title” property. This is used by various components to show the user the name of the project. This may include the omnibar and the window title.
Since: 3.32
GFile *
ide_context_ref_workdir (IdeContext *self
);
Gets the working-directory of the context and increments the reference count by one.
Since: 3.32
void ide_context_set_workdir (IdeContext *self
,GFile *workdir
);
Sets the working directory for the project.
This should generally only be set once after checking out the project.
In future releases, changes may be made to change this in support of git-worktrees or similar workflows.
Since: 3.32
GFile * ide_context_build_file (IdeContext *self
,const gchar *path
);
Creates a new GFile for the path.
Since: 3.32
gchar * ide_context_build_filename (IdeContext *self
,const gchar *first_part
,...
);
Creates a new path that starts from the working directory of the loaded project.
Since: 3.32
GFile * ide_context_cache_file (IdeContext *self
,const gchar *first_part
,...
);
Like ide_context_cache_filename()
but returns a GFile.
Since: 3.32
gchar * ide_context_cache_filename (IdeContext *self
,const gchar *first_part
,...
);
Creates a new filename that will be located in the projects cache directory. This makes it convenient to remove files when a project is deleted as all cache files will share a unified parent directory.
The file will be located in a directory similar to
~/.cache/gnome-builder/project_name. This may change based on the value
of g_get_user_cache_dir()
.
Since: 3.32
GSettings *
ide_context_ref_project_settings (IdeContext *self
);
Gets an org.gnome.builder.project GSettings.
This creates a new GSettings instance for the project.
Since: 3.32
IdeContext *
ide_object_ref_context (IdeObject *self
);
Gets the root IdeContext for the object, if any.
Since: 3.32
IdeContext *
ide_object_get_context (IdeObject *object
);
Gets the IdeContext for the object.
Since: 3.32
void ide_context_log (IdeContext *self
,GLogLevelFlags level
,const gchar *domain
,const gchar *message
);
“project-id”
property “project-id” char *
The "project-id" property is the identifier to use when creating files and folders for this project. It has a mutated form of either the directory or some other discoverable trait of the project.
It has also been modified to remove spaces and other unsafe characters for file-systems.
This may change during runtime, but usually only once when the project has been initialize loaded.
Before any project has loaded, this is "empty" to allow flexibility for non-project use.
Owner: IdeContext
Flags: Read / Write
Default value: "empty"
Since: 3.32
“title”
property “title” char *
The "title" property is a descriptive name for the project.
Owner: IdeContext
Flags: Read / Write
Default value: NULL
Since: 3.32
“workdir”
property“workdir” GFile *
The "workdir" property is the best guess at the working directory for the context. This may be discovered using a common parent if multiple files are opened without a project.
Owner: IdeContext
Flags: Read / Write
Since: 3.32
“log”
signalvoid user_function (IdeContext *self, guint severity, char *domain, char *message, gpointer user_data)
This signal is emitted when a log item has been added for the context.
self |
an IdeContext |
|
severity |
the log severity |
|
domain |
the log domain |
|
message |
the log message |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 3.32