Bibata_Cursor/builder/cursor.py

65 lines
1.8 KiB
Python
Raw Normal View History

2020-10-08 02:29:27 -04:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
2020-11-07 07:27:31 -05:00
from clickgen import build_cursor_theme, build_win_cursor_theme, build_x11_cursor_theme
2020-10-09 03:17:47 -04:00
from .bundler import Bundler
2020-11-07 07:27:31 -05:00
from .config import ConfigProvider, delay, hotspots, sizes
2020-10-08 02:29:27 -04:00
2020-10-24 00:33:29 -04:00
class CursorBuilder:
2020-10-08 02:29:27 -04:00
"""
2020-10-24 00:33:29 -04:00
Build Bibata Windows & X11 cursors 🚀.
2020-10-08 02:29:27 -04:00
"""
2020-10-10 07:50:01 -04:00
def __init__(self, config: ConfigProvider) -> None:
self.__name = config.name
self.__bitmaps_dir = config.bitmaps_dir
self.__bundler = Bundler(config)
self.__tmpdir = config.tmpdir
2020-10-08 08:15:11 -04:00
2020-10-09 03:17:47 -04:00
def build_x11_cursors(self) -> None:
2020-10-14 22:55:11 -04:00
""" Build `x11` platform cursors. """
2020-10-24 00:33:29 -04:00
print("🌈 Building %s Theme ..." % self.__name)
2020-10-08 08:15:11 -04:00
build_x11_cursor_theme(
name=self.__name,
2020-10-10 07:50:01 -04:00
image_dir=self.__bitmaps_dir,
2020-10-09 03:17:47 -04:00
cursor_sizes=sizes,
hotspots=hotspots,
2020-10-10 07:50:01 -04:00
out_path=self.__tmpdir,
2020-10-08 08:15:11 -04:00
archive=False,
2020-10-24 00:33:29 -04:00
delay=delay,
2020-10-08 08:15:11 -04:00
)
2020-10-10 07:50:01 -04:00
self.__bundler.x11_bundle()
2020-10-09 03:17:47 -04:00
def build_win_cursors(self) -> None:
2020-10-14 22:55:11 -04:00
""" Build `Windows` platform cursors. """
2020-10-24 00:33:29 -04:00
print("🌈 Building %s Theme ..." % self.__name)
2020-10-08 08:15:11 -04:00
build_win_cursor_theme(
name=self.__name,
2020-10-10 07:50:01 -04:00
image_dir=self.__bitmaps_dir,
2020-10-09 03:17:47 -04:00
cursor_sizes=sizes,
hotspots=hotspots,
2020-10-10 07:50:01 -04:00
out_path=self.__tmpdir,
2020-10-08 08:15:11 -04:00
archive=False,
2020-10-24 00:33:29 -04:00
delay=delay,
2020-10-08 08:15:11 -04:00
)
2020-10-08 02:29:27 -04:00
2020-10-10 07:50:01 -04:00
self.__bundler.win_bundle()
2020-10-09 03:17:47 -04:00
def build_cursors(self) -> None:
2020-10-14 22:55:11 -04:00
""" Build `x11` & `Windows` platform cursors. """
2020-10-24 00:33:29 -04:00
print("🌈 Building %s Theme ..." % self.__name)
2020-10-08 08:15:11 -04:00
build_cursor_theme(
name=self.__name,
2020-10-10 07:50:01 -04:00
image_dir=self.__bitmaps_dir,
2020-10-09 03:17:47 -04:00
cursor_sizes=sizes,
hotspots=hotspots,
2020-10-10 07:50:01 -04:00
out_path=self.__tmpdir,
2020-10-08 08:15:11 -04:00
archive=False,
2020-10-24 00:33:29 -04:00
delay=delay,
2020-10-08 08:15:11 -04:00
)
2020-10-09 03:17:47 -04:00
2020-10-10 07:50:01 -04:00
self.__bundler.bundle()