diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2010-11-06 00:29:36 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2010-11-06 00:29:36 (GMT) |
commit | 828124e38d266e382bb1477ef51c9fac8e81c591 (patch) | |
tree | 37d1d6af336987030791ba4c41b89a8cf144d270 /src/glibext/gbufferline.c | |
parent | c1ff0021b42fb5738a0cb31da15c12eb6dfac816 (diff) |
Defined the entry point for decompilations.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@189 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/glibext/gbufferline.c')
-rw-r--r-- | src/glibext/gbufferline.c | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/src/glibext/gbufferline.c b/src/glibext/gbufferline.c index da08184..701cb4b 100644 --- a/src/glibext/gbufferline.c +++ b/src/glibext/gbufferline.c @@ -24,6 +24,8 @@ #include "gbufferline.h" +#include <gtk/gtk.h> /* Récupération du langage par défaut ; FIXME ? */ + #include <malloc.h> /* FIXME : à virer */ @@ -72,6 +74,9 @@ struct _GBufferLineClass { GObjectClass parent; /* A laisser en premier */ + PangoContext *context; /* Contexte graphique Pango */ + PangoAttrList *attribs[RTT_COUNT]; /* Décorateurs pour tampons */ + }; @@ -233,6 +238,117 @@ G_DEFINE_TYPE(GBufferLine, g_buffer_line, G_TYPE_OBJECT); static void g_buffer_line_class_init(GBufferLineClass *class) { + GdkScreen *screen; /* Ecran pour GDK */ + PangoFontDescription *font_desc; /* Police de caractère */ + PangoAttribute *attrib; /* Propriété de rendu */ + + /* Base des exportations */ + + screen = gdk_screen_get_default(); + class->context = gdk_pango_context_get_for_screen(screen); + + font_desc = pango_font_description_from_string("mono 10"); + pango_context_set_font_description(class->context, font_desc); + + pango_context_set_base_dir(class->context, PANGO_DIRECTION_LTR); + pango_context_set_language(class->context, gtk_get_default_language()); + + /* RTT_RAW */ + + class->attribs[RTT_RAW] = pango_attr_list_new(); + + attrib = pango_attr_foreground_new(0, 0, 0); + pango_attr_list_insert(class->attribs[RTT_RAW], attrib); + + /* RTT_COMMENT */ + + class->attribs[RTT_COMMENT] = pango_attr_list_new(); + + attrib = pango_attr_foreground_new(14335, 45311, 23551); + pango_attr_list_insert(class->attribs[RTT_COMMENT], attrib); + + /* RTT_RAW_CODE */ + + class->attribs[RTT_RAW_CODE] = pango_attr_list_new(); + + attrib = pango_attr_foreground_new(48895, 48895, 48895); + pango_attr_list_insert(class->attribs[RTT_RAW_CODE], attrib); + + /* RTT_INSTRUCTION */ + + class->attribs[RTT_INSTRUCTION] = pango_attr_list_new(); + + attrib = pango_attr_foreground_new(0, 0, 0); + pango_attr_list_insert(class->attribs[RTT_INSTRUCTION], attrib); + + /* RTT_IMMEDIATE */ + + class->attribs[RTT_IMMEDIATE] = pango_attr_list_new(); + + attrib = pango_attr_foreground_new(41215, 8447, 61695); + pango_attr_list_insert(class->attribs[RTT_IMMEDIATE], attrib); + + /* RTT_REGISTER */ + + class->attribs[RTT_REGISTER] = pango_attr_list_new(); + + //attrib = pango_attr_foreground_new(23551, 23551, 51455); + attrib = pango_attr_foreground_new(16895, 16895, 53759); + pango_attr_list_insert(class->attribs[RTT_REGISTER], attrib); + + /* RTT_HOOK */ + + class->attribs[RTT_HOOK] = pango_attr_list_new(); + + attrib = pango_attr_foreground_new(0, 0, 0); + pango_attr_list_insert(class->attribs[RTT_HOOK], attrib); + + attrib = pango_attr_weight_new(PANGO_WEIGHT_BOLD); + pango_attr_list_insert(class->attribs[RTT_HOOK], attrib); + + /* RTT_SIGNS */ + + class->attribs[RTT_SIGNS] = pango_attr_list_new(); + + attrib = pango_attr_foreground_new(0, 0, 0); + pango_attr_list_insert(class->attribs[RTT_SIGNS], attrib); + + attrib = pango_attr_weight_new(PANGO_WEIGHT_SEMIBOLD); + pango_attr_list_insert(class->attribs[RTT_SIGNS], attrib); + + /* RTT_LTGT */ + + class->attribs[RTT_LTGT] = pango_attr_list_new(); + + /* RTT_SECTION */ + + class->attribs[RTT_SECTION] = pango_attr_list_new(); + + attrib = pango_attr_foreground_new(51200, 2560, 2560); + pango_attr_list_insert(class->attribs[RTT_SECTION], attrib); + + /* + attrib = pango_attr_foreground_new(56832, 26880, 43008); + pango_attr_list_insert(class->attribs[RTT_SECTION], attrib); + + attrib = pango_attr_weight_new(PANGO_WEIGHT_BOLD); + pango_attr_list_insert(class->attribs[RTT_SECTION], attrib); + */ + + /* RTT_SEGMENT */ + + class->attribs[RTT_SEGMENT] = pango_attr_list_new(); + + /* RTT_STRING */ + + class->attribs[RTT_STRING] = pango_attr_list_new(); + + attrib = pango_attr_foreground_new(52224, 32256, 0); + pango_attr_list_insert(class->attribs[RTT_STRING], attrib); + + /* RTT_VAR_NAME */ + + class->attribs[RTT_VAR_NAME] = pango_attr_list_new(); } @@ -308,6 +424,35 @@ void g_buffer_line_add_segment(GBufferLine *line, BufferLineColumn index, GBuffe /****************************************************************************** * * +* Paramètres : line = ligne à venir compléter. * +* 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 à formater dans une ligne donnée. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_buffer_line_insert_text(GBufferLine *line, BufferLineColumn column, const char *text, size_t length, RenderingTagType type) +{ + GBufferLineClass *class; /* Stockage de briques de base */ + GBufferSegment *segment; /* Portion de texte à ajouter */ + + class = G_BUFFER_LINE_GET_CLASS(line); + + segment = g_buffer_segment_new(class->context, class->attribs[type], text, length); + g_buffer_line_add_segment(line, column, segment); + +} + + +/****************************************************************************** +* * * Paramètres : line = ligne à venir compléter. * * index = index de la colonne visée par la procédure. * * * |