Remove dead code

This commit is contained in:
o9000 2018-01-19 20:49:38 +00:00
parent b70edc437c
commit 28b1174c0f
9 changed files with 15 additions and 41 deletions

View file

@ -287,11 +287,10 @@ int button_compute_desired_size(void *obj)
icon_h = icon_w = 0;
}
int txt_height_ink, txt_height, txt_width;
int txt_height, txt_width;
if (button->backend->text) {
if (panel_horizontal) {
get_text_size2(button->backend->font_desc,
&txt_height_ink,
&txt_height,
&txt_width,
panel->area.height,
@ -304,7 +303,6 @@ int button_compute_desired_size(void *obj)
panel->scale);
} else {
get_text_size2(button->backend->font_desc,
&txt_height_ink,
&txt_height,
&txt_width,
panel->area.height,
@ -318,7 +316,7 @@ int button_compute_desired_size(void *obj)
panel->scale);
}
} else {
txt_height_ink = txt_height = txt_width = 0;
txt_height = txt_width = 0;
}
if (panel_horizontal) {
@ -371,10 +369,9 @@ gboolean resize_button(void *obj)
available_h = panel->area.height;
}
int txt_height_ink, txt_height, txt_width;
int txt_height, txt_width;
if (button->backend->text) {
get_text_size2(button->backend->font_desc,
&txt_height_ink,
&txt_height,
&txt_width,
available_h,
@ -386,7 +383,7 @@ gboolean resize_button(void *obj)
FALSE,
panel->scale);
} else {
txt_height_ink = txt_height = txt_width = 0;
txt_height = txt_width = 0;
}
gboolean result = FALSE;

View file

@ -261,10 +261,8 @@ void clock_default_font_changed()
}
void clock_compute_text_geometry(Clock *clock,
int *time_height_ink,
int *time_height,
int *time_width,
int *date_height_ink,
int *date_height,
int *date_width)
{
@ -273,10 +271,8 @@ void clock_compute_text_geometry(Clock *clock,
time2_format ? buf_date : NULL,
time1_font_desc,
time2_font_desc,
time_height_ink,
time_height,
time_width,
date_height_ink,
date_height,
date_width);
}

View file

@ -304,7 +304,6 @@ void execp_compute_icon_text_geometry(Execp *execp,
int *icon_w,
int *icon_h,
gboolean *text_next_line,
int *txt_height_ink,
int *txt_height,
int *txt_width,
int *new_size,
@ -342,7 +341,6 @@ void execp_compute_icon_text_geometry(Execp *execp,
available_h = panel->area.height;
}
get_text_size2(execp->backend->font_desc,
txt_height_ink,
txt_height,
txt_width,
available_h,
@ -386,7 +384,7 @@ int execp_compute_desired_size(void *obj)
int horiz_padding, vert_padding, interior_padding;
int icon_w, icon_h;
gboolean text_next_line;
int txt_height_ink, txt_height, txt_width;
int txt_height, txt_width;
int new_size;
gboolean resized;
execp_compute_icon_text_geometry(execp,
@ -396,7 +394,6 @@ int execp_compute_desired_size(void *obj)
&icon_w,
&icon_h,
&text_next_line,
&txt_height_ink,
&txt_height,
&txt_width,
&new_size,
@ -411,7 +408,7 @@ gboolean resize_execp(void *obj)
int horiz_padding, vert_padding, interior_padding;
int icon_w, icon_h;
gboolean text_next_line;
int txt_height_ink, txt_height, txt_width;
int txt_height, txt_width;
int new_size;
gboolean resized;
execp_compute_icon_text_geometry(execp,
@ -421,7 +418,6 @@ gboolean resize_execp(void *obj)
&icon_w,
&icon_h,
&text_next_line,
&txt_height_ink,
&txt_height,
&txt_width,
&new_size,
@ -492,6 +488,7 @@ void draw_execp(void *obj, cairo_t *c)
// draw layout
pango_layout_set_font_description(layout, execp->backend->font_desc);
pango_layout_set_width(layout, (execp->frontend->textw + TINT2_PANGO_SLACK) * PANGO_SCALE);
pango_layout_set_height(layout, (execp->frontend->texth + TINT2_PANGO_SLACK) * PANGO_SCALE);
pango_layout_set_alignment(layout, execp->backend->centered ? PANGO_ALIGN_CENTER : PANGO_ALIGN_LEFT);
pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR);
pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE);

View file

@ -333,9 +333,8 @@ void init_taskbar_panel(void *p)
}
// compute vertical position : text and icon
int height_ink, height, width;
int height, width;
get_text_size2(panel->g_task.font_desc,
&height_ink,
&height,
&width,
panel->area.height,

View file

@ -134,9 +134,8 @@ int taskbarname_compute_desired_size(void *obj)
{
TaskbarName *taskbar_name = (TaskbarName *)obj;
Panel *panel = (Panel *)taskbar_name->area.panel;
int name_height, name_width, name_height_ink;
int name_height, name_width;
get_text_size2(panel_config.taskbarname_font_desc,
&name_height_ink,
&name_height,
&name_width,
panel->area.height,
@ -162,9 +161,8 @@ gboolean resize_taskbarname(void *obj)
schedule_redraw(&taskbar_name->area);
int name_height, name_width, name_height_ink;
int name_height, name_width;
get_text_size2(panel_config.taskbarname_font_desc,
&name_height_ink,
&name_height,
&name_width,
panel->area.height,

View file

@ -929,10 +929,8 @@ void area_compute_text_geometry(Area *area,
const char *line2,
PangoFontDescription *line1_font_desc,
PangoFontDescription *line2_font_desc,
int *line1_height_ink,
int *line1_height,
int *line1_width,
int *line2_height_ink,
int *line2_height,
int *line2_width)
{
@ -941,7 +939,6 @@ void area_compute_text_geometry(Area *area,
if (line1 && line1[0])
get_text_size2(line1_font_desc,
line1_height_ink,
line1_height,
line1_width,
available_h,
@ -953,11 +950,10 @@ void area_compute_text_geometry(Area *area,
FALSE,
((Panel*)area->panel)->scale);
else
*line1_width = *line1_height_ink = *line1_height = 0;
*line1_width = *line1_height = 0;
if (line2 && line2[0])
get_text_size2(line2_font_desc,
line2_height_ink,
line2_height,
line2_width,
available_h,
@ -969,7 +965,7 @@ void area_compute_text_geometry(Area *area,
FALSE,
((Panel*)area->panel)->scale);
else
*line2_width = *line2_height_ink = *line2_height = 0;
*line2_width = *line2_height = 0;
}
int text_area_compute_desired_size(Area *area,
@ -978,16 +974,14 @@ int text_area_compute_desired_size(Area *area,
PangoFontDescription *line1_font_desc,
PangoFontDescription *line2_font_desc)
{
int line1_height_ink, line1_height, line1_width, line2_height_ink, line2_height, line2_width;
int line1_height, line1_width, line2_height, line2_width;
area_compute_text_geometry(area,
line1,
line2,
line1_font_desc,
line2_font_desc,
&line1_height_ink,
&line1_height,
&line1_width,
&line2_height_ink,
&line2_height,
&line2_width);
@ -1012,17 +1006,15 @@ gboolean resize_text_area(Area *area,
schedule_redraw(area);
int line1_height_ink, line1_height, line1_width;
int line2_height_ink, line2_height, line2_width;
int line1_height, line1_width;
int line2_height, line2_width;
area_compute_text_geometry(area,
line1,
line2,
line1_font_desc,
line2_font_desc,
&line1_height_ink,
&line1_height,
&line1_width,
&line2_height_ink,
&line2_height,
&line2_width);

View file

@ -273,10 +273,8 @@ void area_compute_text_geometry(Area *area,
const char *line2,
PangoFontDescription *line1_font_desc,
PangoFontDescription *line2_font_desc,
int *line1_height_ink,
int *line1_height,
int *line1_width,
int *line2_height_ink,
int *line2_height,
int *line2_width);
int text_area_compute_desired_size(Area *area,

View file

@ -925,7 +925,6 @@ void clear_pixmap(Pixmap p, int x, int y, int w, int h)
}
void get_text_size2(const PangoFontDescription *font,
int *height_ink,
int *height,
int *width,
int available_height,
@ -962,7 +961,6 @@ void get_text_size2(const PangoFontDescription *font,
pango_layout_set_markup(layout, text, text_len);
pango_layout_get_pixel_extents(layout, &rect_ink, &rect);
*height_ink = rect_ink.height;
*height = rect.height;
*width = rect.width;
// fprintf(stderr, "tint2: dimension : %d - %d\n", rect_ink.height, rect.height);

View file

@ -114,7 +114,6 @@ void create_heuristic_mask(DATA32 *data, int w, int h);
void render_image(Drawable d, int x, int y);
void get_text_size2(const PangoFontDescription *font,
int *height_ink,
int *height,
int *width,
int available_height,