summaryrefslogtreecommitdiff
path: root/src/analysis/exporter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/exporter.c')
-rw-r--r--src/analysis/exporter.c92
1 files changed, 92 insertions, 0 deletions
diff --git a/src/analysis/exporter.c b/src/analysis/exporter.c
index e1e9160..5820fd6 100644
--- a/src/analysis/exporter.c
+++ b/src/analysis/exporter.c
@@ -46,9 +46,49 @@ G_DEFINE_TYPE(GContentExporter, g_content_exporter, G_TYPE_OBJECT);
static void g_content_exporter_class_init(GContentExporterClass *klass)
{
+ GdkScreen *screen; /* Ecran pour GDK */
+ PangoFontDescription *font_desc; /* Police de caractère */
GtkTextTagTable *table; /* Seule table globale valable */
GtkTextTag *tag;
+ /* Exportation vers un tampon de code */
+
+ screen = gdk_screen_get_default();
+
+ font_desc = pango_font_description_from_string("mono 10");
+
+ klass->context = gdk_pango_context_get_for_screen(screen);
+
+ pango_context_set_font_description(klass->context, font_desc);
+ pango_context_set_base_dir(klass->context, PANGO_DIRECTION_LTR);
+ pango_context_set_language(klass->context, gtk_get_default_language());
+
+ klass->attribs[RTT_RAW] = pango_attr_list_new();
+
+ klass->attribs[RTT_COMMENT] = pango_attr_list_new();
+
+ klass->attribs[RTT_RAW_CODE] = pango_attr_list_new();
+
+ klass->attribs[RTT_INSTRUCTION] = pango_attr_list_new();
+
+ klass->attribs[RTT_IMMEDIATE] = pango_attr_list_new();
+
+ klass->attribs[RTT_REGISTER] = pango_attr_list_new();
+
+ klass->attribs[RTT_HOOK] = pango_attr_list_new();
+
+ klass->attribs[RTT_SIGNS] = pango_attr_list_new();
+
+ klass->attribs[RTT_LTGT] = pango_attr_list_new();
+
+ klass->attribs[RTT_SEGMENT] = pango_attr_list_new();
+
+ klass->attribs[RTT_STRING] = pango_attr_list_new();
+
+ klass->attribs[RTT_VAR_NAME] = pango_attr_list_new();
+
+
+
/* Décorateurs GTK */
table = get_gtk_tag_table();
@@ -207,6 +247,36 @@ void g_content_exporter_insert_text(GContentExporter *exporter, FILE *stream, co
/******************************************************************************
* *
* Paramètres : exporter = instance sachant exporter son contenu. *
+* buffer = espace où placer ledit contenu. *
+* column = colonne de la ligne visée par l'insertion. *
+* text = texte à insérer dans l'existant. *
+* length = taille du texte à traiter. *
+* type = type de décorateur à utiliser. *
+* *
+* Description : Ajoute du texte à un tampon de code via l'instance spécifiée.*
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_content_exporter_insert_into_buffer(GContentExporter *exporter, GBufferLine *buffer, BufferLineColumn column, const char *text, size_t length, RenderingTagType type)
+{
+ GContentExporterClass *class; /* Stockage de briques de base */
+ GBufferSegment *segment; /* Portion de texte à ajouter */
+
+ class = G_CONTENT_EXPORTER_GET_CLASS(exporter);
+
+ segment = g_buffer_segment_new(class->context, class->attribs[type], text, length);
+ g_buffer_line_add_segment(buffer, column, segment);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : exporter = instance sachant exporter son contenu. *
* buffer = zone de texte à venir compléter. *
* iter = point d'insertion du nouveau texte. [OUT] *
* text = texte à insérer dans l'existant. *
@@ -260,6 +330,28 @@ void g_content_exporter_add_text(GContentExporter *exporter, GRenderingOptions *
/******************************************************************************
* *
+* Paramètres : exporter = instance sachant exporter son contenu. *
+* line = espace où placer ledit contenu. *
+* options = options de rendu. *
+* *
+* Description : Ajoute à un tampon GLib le contenu de l'instance spécifiée. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_content_exporter_to_buffer(GContentExporter *exporter, GBufferLine *line, GRenderingOptions *options)
+{
+ if (exporter->export_buffer != NULL)
+ exporter->export_buffer(exporter, line, options);
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : exporter = instance sachant exporter son contenu. *
* rendering = support effectif final des lignes de code. *
* buffer = zone de texte à venir compléter. *