diff --git a/MANIFEST.in b/MANIFEST.in index ac5aa319..fb9bb06b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,2 @@ -recursive-include builder/windows.inf \ No newline at end of file +recursive-include builder/windows.inf +recursive-include builder/hotspots.json \ No newline at end of file diff --git a/builder/__init__.py b/builder/__init__.py index 56d6e2ac..0b1e1743 100644 --- a/builder/__init__.py +++ b/builder/__init__.py @@ -2,6 +2,6 @@ # -*- coding: utf-8 -*- from .cursor import CursorBuilder -from .provider import ConfigProvider +from .provider import ConfigsProvider __version__: str = "1.0.1" diff --git a/builder/cursor.py b/builder/cursor.py index d5c4f6fc..d8bbba6d 100644 --- a/builder/cursor.py +++ b/builder/cursor.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- import builder -from .provider import ConfigProvider +from .provider import ConfigsProvider class CursorBuilder(): @@ -10,7 +10,7 @@ class CursorBuilder(): docstring """ - def __init__(self, config: ConfigProvider): + def __init__(self, configs: ConfigsProvider): print("⚡ Bibata Builder Version %s" % builder.__version__) - self.__config = config + self.__configs = configs diff --git a/builder/hotspots.json b/builder/hotspots.json new file mode 100644 index 00000000..2271367a --- /dev/null +++ b/builder/hotspots.json @@ -0,0 +1,99 @@ +{ + "all_scroll": { "xhot": 100, "yhot": 100 }, + "dotbox": { "xhot": 100, "yhot": 100 }, + "move": { "xhot": 100, "yhot": 100 }, + "plus": { "xhot": 100, "yhot": 100 }, + "vertical_text": { "xhot": 100, "yhot": 100 }, + "wait": { "xhot": 100, "yhot": 100 }, + "wayland_cursor": { "xhot": 100, "yhot": 100 }, + "x_cursor": { "xhot": 100, "yhot": 100 }, + "xterm": { "xhot": 100, "yhot": 100 }, + + "bd_double_arrow": { "xhot": 98, "yhot": 100 }, + "fd_double_arrow": { "xhot": 98, "yhot": 100 }, + + "bottom_left_corner": { "xhot": 31, "yhot": 172 }, + "bottom_right_corner": { "xhot": 170, "yhot": 172 }, + + "bottom_side": { "xhot": 100, "yhot": 164 }, + "bottom_tee": { "xhot": 100, "yhot": 164 }, + + "center_ptr": { "xhot": 98, "yhot": 131 }, + + "circle": { "xhot": 48, "yhot": 25 }, + "context_menu": { "xhot": 48, "yhot": 25 }, + "copy": { "xhot": 48, "yhot": 25 }, + "link": { "xhot": 48, "yhot": 25 }, + "pointer_move": { "xhot": 48, "yhot": 25 }, + + "cross": { "xhot": 98, "yhot": 96 }, + + "crossed_circle": { "xhot": 100, "yhot": 100 }, + + "crosshair": { "xhot": 99, "yhot": 99 }, + + "dnd_ask": { "xhot": 86, "yhot": 79 }, + "dnd_copy": { "xhot": 86, "yhot": 79 }, + "dnd_link": { "xhot": 86, "yhot": 79 }, + "dnd_move": { "xhot": 86, "yhot": 79 }, + "dnd_no_drop": { "xhot": 86, "yhot": 79 }, + + "dnd_none": { "xhot": 99, "yhot": 98 }, + + "grabbing": { "xhot": 106, "yhot": 79 }, + + "hand1": { "xhot": 113, "yhot": 95 }, + + "hand2": { "xhot": 88, "yhot": 32 }, + + "left_ptr_watch": { "xhot": 50, "yhot": 28 }, + + "left_ptr": { "xhot": 53, "yhot": 36 }, + + "left_side": { "xhot": 35, "yhot": 100 }, + + "left_tee": { "xhot": 165, "yhot": 95 }, + + "ll_angle": { "xhot": 34, "yhot": 165 }, + + "lr_angle": { "xhot": 167, "yhot": 164 }, + + "pencil": { "xhot": 37, "yhot": 161 }, + + "question_arrow": { "xhot": 102, "yhot": 102 }, + + "right_ptr": { "xhot": 150, "yhot": 29 }, + + "right_side": { "xhot": 163, "yhot": 98 }, + + "right_tee": { "xhot": 30, "yhot": 96 }, + + "sb_down_arrow": { "xhot": 100, "yhot": 126 }, + + "sb_h_double_arrow": { "xhot": 100, "yhot": 100 }, + "sb_v_double_arrow": { "xhot": 100, "yhot": 100 }, + + "sb_left_arrow": { "xhot": 86, "yhot": 100 }, + + "sb_right_arrow": { "xhot": 113, "yhot": 100 }, + + "sb_up_arrow": { "xhot": 99, "yhot": 86 }, + + "tcross": { "xhot": 98, "yhot": 100 }, + + "top_left_corner": { "xhot": 29, "yhot": 27 }, + + "top_right_corner": { "xhot": 170, "yhot": 28 }, + + "top_side": { "xhot": 98, "yhot": 34 }, + + "top_tee": { "xhot": 98, "yhot": 29 }, + + "ul_angle": { "xhot": 34, "yhot": 35 }, + + "ur_angle": { "xhot": 164, "yhot": 34 }, + + "zoom_in": { "xhot": 90, "yhot": 89 }, + + "zoom_out": { "xhot": 93, "yhot": 90 } +} diff --git a/builder/log.py b/builder/log.py new file mode 100644 index 00000000..5bb565c7 --- /dev/null +++ b/builder/log.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import logging +import os + +logging.basicConfig(filename='%s/build.log' % os.getcwd(), filemode='w', + format='%(name)s - %(levelname)s - %(message)s', level=logging.DEBUG) diff --git a/builder/packager.py b/builder/packager.py index c8b98217..1279fac5 100644 --- a/builder/packager.py +++ b/builder/packager.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from .provider import ConfigProvider +from .provider import ConfigsProvider class Packager(): @@ -9,5 +9,5 @@ class Packager(): Create Crisp 📦 Packages for Windows & X11 Cursor Theme. """ - def __init__(self, config: ConfigProvider): - self.__config = config + def __init__(self, configs: ConfigsProvider): + self.__configs = configs diff --git a/builder/provider.py b/builder/provider.py index 4102d892..20fc984d 100644 --- a/builder/provider.py +++ b/builder/provider.py @@ -2,13 +2,15 @@ # -*- coding: utf-8 -*- import os +import log import sys +import json import builder from os import path, listdir import shutil -class ConfigProvider(): +class ConfigsProvider(): """ Configure `Bibata` building process. """ @@ -53,6 +55,10 @@ class ConfigProvider(): self.__bitmaps_dir: str = bitmaps_dir self.__out_dir: str = out_dir + # read hotspots file + with open(path.join(builder.__path__[0], "hotspots.json")) as hotspot_file: + self.hotspots = json.loads(hotspot_file.read()) + def get_windows_script(self, theme_name: str, author: str) -> str: with open(path.join(builder.__path__[0], "windows.inf")) as f: