Sat, 09 Aug 2025 17:37:27 +0800
Fix the birb header path
The birb header referred would only work with birb provided by wrap casuing
build to fail because of system-installed birb dependency. The commit points
it to the correct path <birb.h>.
See: https://keep.imfreedom.org/birb/birb/file/5bf00c7d7f80/birb/meson.build#l77
| 43293 | 1 | /* |
| 2 | * Purple - Internet Messaging Library | |
| 3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> | |
| 4 | * | |
| 5 | * Purple is the legal property of its developers, whose names are too numerous | |
| 6 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 7 | * source distribution. | |
| 8 | * | |
| 9 | * This library is free software; you can redistribute it and/or modify it | |
| 10 | * under the terms of the GNU General Public License as published by the Free | |
| 11 | * Software Foundation; either version 2 of the License, or (at your option) | |
| 12 | * any later version. | |
| 13 | * | |
| 14 | * This library is distributed in the hope that it will be useful, but WITHOUT | |
| 15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
| 17 | * more details. | |
| 18 | * | |
| 19 | * You should have received a copy of the GNU General Public License along with | |
| 20 | * this library; if not, see <https://www.gnu.org/licenses/>. | |
| 21 | */ | |
| 22 | ||
| 23 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) | |
| 24 | # error "only <purple.h> may be included directly" | |
| 25 | #endif | |
| 26 | ||
| 27 | #ifndef PURPLE_SCHEDULER_H | |
| 28 | #define PURPLE_SCHEDULER_H | |
| 29 | ||
| 30 | #include <glib.h> | |
| 31 | #include <glib-object.h> | |
| 32 | ||
| 33 | #include "purplescheduledtask.h" | |
| 34 | #include "purpleversion.h" | |
| 35 | ||
| 36 | G_BEGIN_DECLS | |
| 37 | ||
| 38 | #define PURPLE_SCHEDULER_ERROR purple_scheduler_error_quark() | |
| 39 | ||
| 40 | /** | |
| 41 | * PurpleSchedulerError: | |
| 42 | * @PURPLE_SCHEDULER_ERROR_TASK_EXISTS: the task has already been added to the | |
| 43 | * scheduler | |
| 44 | * @PURPLE_SCHEDULER_ERROR_FAILED_TO_SCHEDULE: the task failed to schedule for | |
| 45 | * an unknown reason | |
| 46 | * | |
| 47 | * Error codes returned by the scheduler. | |
| 48 | * | |
| 49 | * Since: 3.0 | |
| 50 | */ | |
| 51 | typedef enum { | |
| 52 | PURPLE_SCHEDULER_ERROR_TASK_EXISTS PURPLE_AVAILABLE_ENUMERATOR_IN_3_0, | |
| 53 | PURPLE_SCHEDULER_ERROR_FAILED_TO_SCHEDULE PURPLE_AVAILABLE_ENUMERATOR_IN_3_0, | |
| 54 | } PurpleSchedulerError; | |
| 55 | ||
| 56 | /** | |
| 57 | * purple_scheduler_error_quark: | |
| 58 | * | |
| 59 | * The error domain to identify errors with the scheduler. | |
| 60 | * | |
| 61 | * Returns: The error domain. | |
| 62 | * | |
| 63 | * Since: 3.0 | |
| 64 | */ | |
| 65 | PURPLE_AVAILABLE_IN_3_0 | |
| 66 | GQuark purple_scheduler_error_quark(void); | |
| 67 | ||
| 68 | /** | |
| 69 | * PurpleScheduler: | |
| 70 | * | |
| 71 | * An object that manages a collection of [class@ScheduledTask]. | |
| 72 | * | |
| 73 | * Since: 3.0 | |
| 74 | */ | |
| 75 | ||
| 76 | #define PURPLE_TYPE_SCHEDULER (purple_scheduler_get_type()) | |
| 77 | ||
| 78 | PURPLE_AVAILABLE_IN_3_0 | |
| 79 | G_DECLARE_FINAL_TYPE(PurpleScheduler, purple_scheduler, PURPLE, SCHEDULER, | |
| 80 | GObject) | |
| 81 | ||
| 82 | /** | |
| 83 | * purple_scheduler_add_task: | |
| 84 | * @task: (transfer none): the task to add | |
| 85 | * @execute_at: (transfer none): the date time for when the task should be | |
| 86 | * executed. | |
| 87 | * @error: (out) (nullable): a return address for a #GError | |
| 88 | * | |
| 89 | * Adds a new task to the scheduler. | |
| 90 | * | |
| 91 | * If the task has already been added, false will be returned and @error will | |
| 92 | * be set. | |
| 93 | * | |
| 94 | * If @task is already scheduled, it will be rescheduled to run at @execute_at. | |
| 95 | * | |
| 96 | * Returns: true if the task was added successfully. | |
| 97 | * | |
| 98 | * Since: 3.0 | |
| 99 | */ | |
| 100 | PURPLE_AVAILABLE_IN_3_0 | |
| 101 | gboolean purple_scheduler_add_task(PurpleScheduler *scheduler, PurpleScheduledTask *task, GDateTime *execute_at, GError **error); | |
| 102 | ||
| 103 | /** | |
| 104 | * purple_scheduler_add_task_relative: | |
| 105 | * @task: (transfer none): the task to add | |
| 106 | * @when: the relative time from now to execute the task | |
| 107 | * @error: (out) (nullable): a return address for a #GError | |
| 108 | * | |
| 109 | * Adds a new task to the scheduler. | |
| 110 | * | |
| 111 | * If the task has already been added, false will be returned and @error will | |
| 112 | * be set. | |
| 113 | * | |
| 114 | * If @task is already scheduled, it will be rescheduled to run at @when. | |
| 115 | * | |
| 116 | * This is a wrapper around [method@Scheduler.add_task] that will add @when to | |
| 117 | * the current time for you. | |
| 118 | * | |
| 119 | * Returns: true if the task was added successfully. | |
| 120 | * | |
| 121 | * Since: 3.0 | |
| 122 | */ | |
| 123 | PURPLE_AVAILABLE_IN_3_0 | |
| 124 | gboolean purple_scheduler_add_task_relative(PurpleScheduler *scheduler, PurpleScheduledTask *task, GTimeSpan when, GError **error); | |
| 125 | ||
| 126 | /** | |
| 127 | * purple_scheduler_get_default: | |
| 128 | * | |
| 129 | * Gets the default scheduler. | |
| 130 | * | |
| 131 | * This can return %NULL if libpurple has not been initialized. | |
| 132 | * | |
| 133 | * Returns: (transfer none) (nullable): The default scheduler. | |
| 134 | * | |
| 135 | * Since: 3.0 | |
| 136 | */ | |
| 137 | PURPLE_AVAILABLE_IN_3_0 | |
| 138 | PurpleScheduler *purple_scheduler_get_default(void); | |
| 139 | ||
| 140 | /** | |
| 141 | * purple_scheduler_get_default_as_model: | |
| 142 | * | |
| 143 | * Gets the default scheduler cast to a [iface@Gio.ListModel]. | |
| 144 | * | |
| 145 | * This can return %NULL if libpurple has not been initialized. | |
| 146 | * | |
| 147 | * Returns: (transfer none) (nullable): The default scheduler as a list model. | |
| 148 | * | |
| 149 | * Since: 3.0 | |
| 150 | */ | |
| 151 | PURPLE_AVAILABLE_IN_3_0 | |
| 152 | GListModel *purple_scheduler_get_default_as_model(void); | |
| 153 | ||
| 154 | /** | |
| 155 | * purple_scheduler_new: | |
| 156 | * | |
| 157 | * Creates a new scheduler. | |
| 158 | * | |
| 159 | * This is typically only used internally but may be useful to others. | |
| 160 | * | |
| 161 | * Returns: (transfer full): The new instance. | |
| 162 | * | |
| 163 | * Since: 3.0 | |
| 164 | */ | |
| 165 | PURPLE_AVAILABLE_IN_3_0 | |
| 166 | PurpleScheduler *purple_scheduler_new(void); | |
| 167 | ||
| 168 | /** | |
| 169 | * purple_scheduler_remove_task: | |
| 170 | * @id: the id of the task | |
| 171 | * | |
| 172 | * Removes a task from the scheduler. | |
| 173 | * | |
| 174 | * If the task is found and currently scheduled, it will be cancelled. | |
| 175 | * | |
| 176 | * Returns: true if the task was found and removed. | |
| 177 | * | |
| 178 | * Since: 3.0 | |
| 179 | */ | |
| 180 | PURPLE_AVAILABLE_IN_3_0 | |
| 181 | gboolean purple_scheduler_remove_task(PurpleScheduler *scheduler, const char *id); | |
| 182 | ||
| 183 | G_END_DECLS | |
| 184 | ||
| 185 | #endif /* PURPLE_SCHEDULER_H */ |