00001 00012 #define GITK_RENDERER_C 00013 #define GITKR_WIDGET_C 00014 00015 #include "gitkrincludes.h" 00016 00018 void gitkr_widget_new(GitkrTextWidgetPtr widget,GitkDialogPtr dialog,xmlNodePtr node) { 00019 gchar *id,*label; 00020 gchar *fg_color,*bg_color,*icon; 00021 00022 id=xmlGetProp(node,"id"); 00023 label=gitkr_cxpath_get_string(dialog,xpath_get_label,node); 00024 fg_color=xmlGetProp(node,"fgcolor"); 00025 bg_color=xmlGetProp(node,"bgcolor"); 00026 icon=xmlGetProp(node,"icon"); 00027 00028 widget->id=id; 00029 widget->dialog=dialog; 00030 widget->label=label; 00031 widget->bg_color=color_name_to_code(bg_color,COLOR_BLACK); 00032 widget->fg_color=color_name_to_code(fg_color,COLOR_WHITE); 00033 widget->dim_bold=color_name_to_attr(fg_color,FALSE); 00034 widget->type=GITK_WIDGET_TYPE_UNDEF; 00035 if(icon && *icon) widget->icon=*icon; 00036 widget->output=NULL; 00037 widget->handle=NULL; 00038 00039 xmlFree(fg_color); 00040 xmlFree(bg_color); 00041 xmlFree(icon); 00042 } 00043 00045 void gitkr_widget_output_pre(GitkrTextWidgetPtr widget,gint line,gboolean active) { 00046 if(active) attron(A_REVERSE); 00047 attron(widget->display_attrs); 00048 mvaddch(line,0,widget->icon);mvaddch(line,1,' '); 00049 } 00050 00052 void gitkr_widget_output_post(GitkrTextWidgetPtr widget,gint line,gboolean active) { 00053 attroff(widget->display_attrs); 00054 if(active) attroff(A_REVERSE); 00055 } 00056