#!/usr/bin/python3 import os MAX_ROWS = 9 MAX_COLS = 9 ICON_NAME_PREFIX = "workspace" WORKSPACE_WIDTH = 50 WORKSPACE_HEIGHT = 50 STROKE_COLOR = "#bebebe" STROKE_WIDTH = 5 BORDER_RADIUS = 10 with open("workspace_icon_template.data") as f: TEMPLATE = f.read() def define_globals(data, width, height): data = data.replace("{{WIDTH}}", str(width)) data = data.replace("{{HEIGHT}}", str(height)) data = data.replace("{{STROKE_COLOR}}", STROKE_COLOR) data = data.replace("{{STROKE_WIDTH}}", str(STROKE_WIDTH)) return data def draw_outer_rectangle(data, width, height): data = data.replace("{{BORDER_RADIUS}}", str(BORDER_RADIUS)) data = data.replace("{{RECTANGLE_X}}", str(STROKE_WIDTH / 2)) data = data.replace("{{RECTANGLE_Y}}", str(STROKE_WIDTH / 2)) data = data.replace("{{RECTANGLE_WIDTH}}", str(width - STROKE_WIDTH)) data = data.replace("{{RECTANGLE_HEIGHT}}", str(height - STROKE_WIDTH)) return data def draw_line(is_horizontal, start_x, start_y, length): data = "" direction = "H" if is_horizontal else "V" data += f'' return data def draw_full_rect(x, y, width, height): data = "" data += f'