summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/analysis/db
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/analysis/db')
-rw-r--r--plugins/pychrysalide/analysis/db/analyst.c4
-rw-r--r--plugins/pychrysalide/analysis/db/constants.c43
-rw-r--r--plugins/pychrysalide/analysis/db/constants.h3
3 files changed, 50 insertions, 0 deletions
diff --git a/plugins/pychrysalide/analysis/db/analyst.c b/plugins/pychrysalide/analysis/db/analyst.c
index 289db31..c55f34a 100644
--- a/plugins/pychrysalide/analysis/db/analyst.c
+++ b/plugins/pychrysalide/analysis/db/analyst.c
@@ -36,6 +36,7 @@
#include "client.h"
#include "collection.h"
+#include "constants.h"
#include "../content.h"
#include "../loaded.h"
#include "../../access.h"
@@ -901,6 +902,9 @@ bool ensure_python_analyst_client_is_registered(void)
if (!register_class_for_pygobject(dict, G_TYPE_ANALYST_CLIENT, type, get_python_hub_client_type()))
return false;
+ if (!define_loading_status_hint_constants(type))
+ return false;
+
}
return true;
diff --git a/plugins/pychrysalide/analysis/db/constants.c b/plugins/pychrysalide/analysis/db/constants.c
index 8e7765a..5e8c20d 100644
--- a/plugins/pychrysalide/analysis/db/constants.c
+++ b/plugins/pychrysalide/analysis/db/constants.c
@@ -25,6 +25,7 @@
#include "constants.h"
+#include <analysis/db/analyst.h>
#include <analysis/db/item.h>
#include <analysis/db/server.h>
@@ -152,3 +153,45 @@ bool define_hub_server_constants(PyTypeObject *type)
return result;
}
+
+
+/******************************************************************************
+* *
+* Paramètres : type = type dont le dictionnaire est à compléter. *
+* *
+* Description : Définit les constantes pour les indications de chargement. *
+* *
+* Retour : true en cas de succès de l'opération, false sinon. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool define_loading_status_hint_constants(PyTypeObject *type)
+{
+ bool result; /* Bilan à retourner */
+ PyObject *values; /* Groupe de valeurs à établir */
+
+ values = PyDict_New();
+
+ result = add_const_to_group(values, "READY", LSH_READY);
+ if (result) result = add_const_to_group(values, "ON_WAIT_LIST", LSH_ON_WAIT_LIST);
+ if (result) result = add_const_to_group(values, "NEED_CONTENT", LSH_NEED_CONTENT);
+ if (result) result = add_const_to_group(values, "NEED_FORMAT", LSH_NEED_FORMAT);
+ if (result) result = add_const_to_group(values, "NEED_ARCH", LSH_NEED_ARCH);
+
+ if (!result)
+ {
+ Py_DECREF(values);
+ goto exit;
+ }
+
+ result = attach_constants_group_to_type_with_pyg_enum(type, false, "LoadingStatusHint", values,
+ "Indication about a loading process state.",
+ G_TYPE_LOADING_STATUS_HINT);
+
+ exit:
+
+ return result;
+
+}
diff --git a/plugins/pychrysalide/analysis/db/constants.h b/plugins/pychrysalide/analysis/db/constants.h
index 5f0afeb..ea7a0c0 100644
--- a/plugins/pychrysalide/analysis/db/constants.h
+++ b/plugins/pychrysalide/analysis/db/constants.h
@@ -39,6 +39,9 @@ bool define_db_item_constants(PyTypeObject *);
/* Définit les constantes pour les serveurs de données. */
bool define_hub_server_constants(PyTypeObject *);
+/* Définit les constantes pour les indications de chargement. */
+bool define_loading_status_hint_constants(PyTypeObject *);
+
#endif /* _PLUGINS_PYCHRYSALIDE_ANALYSIS_DB_CONSTANTS_H */