/* File: pencil_size.inl; Copyright and License: see below */ #include "u8/u8_log.h" #include static inline void pencil_size_init( pencil_size_t *this_, double width, double height ) { pencil_size_init_empty( this_ ); pencil_size_reinit( this_, width, height); } static inline void pencil_size_destroy( pencil_size_t *this_ ) { pango_font_description_free ( (*this_).footnote_font_description ); (*this_).footnote_font_description = NULL; pango_font_description_free ( (*this_).standard_font_description ); (*this_).standard_font_description = NULL; pango_font_description_free ( (*this_).title_font_description ); (*this_).title_font_description = NULL; } static const char *PENCIL_SIZE_FONT_FAMILY = "Sans"; static inline void pencil_size_init_empty( pencil_size_t *this_ ) { (*this_).standard_color.red = 0.0; (*this_).standard_color.green = 0.0; (*this_).standard_color.blue = 0.0; (*this_).standard_color.alpha = 1.0; (*this_).select_color.red = 1.0; (*this_).select_color.green = 0.3; (*this_).select_color.blue = 0.8; (*this_).select_color.alpha = 1.0; (*this_).highlight_color.red = 0.0; (*this_).highlight_color.green = 0.6; (*this_).highlight_color.blue = 0.4; (*this_).highlight_color.alpha = 1.0; (*this_).focus_color.red = 0.9; (*this_).focus_color.green = 0.85; (*this_).focus_color.blue = 0.0; (*this_).focus_color.alpha = 1.0; (*this_).emphasized_bgcolor.red = 1.0; (*this_).emphasized_bgcolor.green = 1.0; (*this_).emphasized_bgcolor.blue = 0.3; (*this_).emphasized_bgcolor.alpha = 1.0; (*this_).gray_out_color.red = 0.7; (*this_).gray_out_color.green = 0.7; (*this_).gray_out_color.blue = 0.7; (*this_).gray_out_color.alpha = 1.0; /* guess some default values: */ (*this_).footnote_font_size = 9.0; (*this_).footnote_font_description = pango_font_description_new (); pango_font_description_set_family_static ( (*this_).footnote_font_description, PENCIL_SIZE_FONT_FAMILY ); pango_font_description_set_style ( (*this_).footnote_font_description, PANGO_STYLE_NORMAL ); pango_font_description_set_weight ( (*this_).footnote_font_description, PANGO_WEIGHT_MEDIUM ); pango_font_description_set_stretch ( (*this_).footnote_font_description, PANGO_STRETCH_NORMAL ); pango_font_description_set_size ( (*this_).footnote_font_description, 9 * PANGO_SCALE ); (*this_).standard_font_size = 12.0; (*this_).standard_font_description = pango_font_description_new (); pango_font_description_set_family_static ( (*this_).standard_font_description, PENCIL_SIZE_FONT_FAMILY ); pango_font_description_set_style ( (*this_).standard_font_description, PANGO_STYLE_NORMAL ); pango_font_description_set_weight ( (*this_).standard_font_description, PANGO_WEIGHT_MEDIUM ); pango_font_description_set_stretch ( (*this_).standard_font_description, PANGO_STRETCH_NORMAL ); pango_font_description_set_size ( (*this_).standard_font_description, 12 * PANGO_SCALE ); (*this_).title_font_size = 14.0; (*this_).title_font_description = pango_font_description_new (); pango_font_description_set_family_static ( (*this_).title_font_description, PENCIL_SIZE_FONT_FAMILY ); pango_font_description_set_style ( (*this_).title_font_description, PANGO_STYLE_NORMAL ); pango_font_description_set_weight ( (*this_).title_font_description, PANGO_WEIGHT_BOLD ); pango_font_description_set_stretch ( (*this_).title_font_description, PANGO_STRETCH_NORMAL ); pango_font_description_set_size ( (*this_).title_font_description, 14 * PANGO_SCALE ); (*this_).standard_line_width = 1.0; (*this_).bold_line_width = 2.0; (*this_).line_dash_length = 5.0; (*this_).standard_object_border = 4.0; (*this_).arrow_stroke_length = 10.0; (*this_).arrow_stroke_087_length = 8.66; (*this_).preferred_object_distance = 20.0; (*this_).classifier_symbol_height = 24.0; } static inline void pencil_size_reinit( pencil_size_t *this_, double width, double height ) { double smaller_border = (width