-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui_abstract.py
executable file
·95 lines (71 loc) · 2.04 KB
/
ui_abstract.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import subprocess
from abc import ABCMeta, abstractmethod
import os
APP_INDICATOR = "Snappo"
class ImageResolverAbstract(metaclass=ABCMeta):
@abstractmethod
def get_noimg_icon(self):
pass
@abstractmethod
def get_lens_icon(self):
pass
@abstractmethod
def get_clear_icon(self):
pass
class NotificationAbstract(metaclass=ABCMeta):
summary = None
body = None
def __init__(self):
self.app=APP_INDICATOR
@abstractmethod
def new(self, summary='', body=''):
pass
@abstractmethod
def show(self):
pass
class SnappoAbstract(metaclass=ABCMeta):
BASH_FILE = "snappo.sh"
delay = 0
menu = None
clipboard_manager = None
screen_grabber = None
def __init__(self, version, screen_grabber, clipboard_manager, notification_manager, image_resolver, image_changing_notifier):
self.APP_INDICATOR = APP_INDICATOR
self.clipboard_manager = clipboard_manager
self.screen_grabber = screen_grabber
self.notification_manager = notification_manager
self.image_resolver = image_resolver
self.image_changing_notifier = image_changing_notifier
self.script_dir=os.path.dirname(os.path.abspath(__file__))
self.BASH_PATH = self.script_dir + "/" + self.BASH_FILE
self.version = version
@abstractmethod
def _add_menu_item(self, label, callback):
pass
@abstractmethod
def _add_menu_item_with_icon(self, label, icon_id, callback):
pass
@abstractmethod
def _build_menu(self):
pass
@abstractmethod
def _set_delay(self, widget):
pass
@abstractmethod
def show_about_dialog(self, widget):
pass
@abstractmethod
def show_delay_dialog(self, widget):
pass
@abstractmethod
def _grab_desktop(self, widget):
pass
@abstractmethod
def _grab_window(self, widget):
pass
@abstractmethod
def _grab_area(self, widget):
pass
@abstractmethod
def quit(self, widget):
pass