diff --git a/core/plugin_api.py b/core/plugin_api.py index 42fb110..4bda204 100644 --- a/core/plugin_api.py +++ b/core/plugin_api.py @@ -1142,6 +1142,65 @@ class PluginAPI: return clipboard.paste() + # ========== Window Manager Service ========== + + def register_window_service(self, window_manager) -> None: + """Register the Window Manager service. + + Args: + window_manager: WindowManager instance from core.window_manager + """ + self.services['window'] = window_manager + print("[API] Window Manager service registered") + + def get_eu_window(self) -> Optional[Dict[str, Any]]: + """Get information about the Entropia Universe game window. + + Returns: + Dict with window info or None if not found + """ + window_manager = self.services.get('window') + if not window_manager: + return None + + return window_manager.find_eu_window() + + def is_eu_focused(self) -> bool: + """Check if Entropia Universe window is currently focused. + + Returns: + True if EU is the active window + """ + window_manager = self.services.get('window') + if not window_manager: + return False + + return window_manager.is_eu_focused() + + def is_eu_visible(self) -> bool: + """Check if Entropia Universe window is visible. + + Returns: + True if EU window is visible (not minimized) + """ + window_manager = self.services.get('window') + if not window_manager: + return False + + return window_manager.is_eu_visible() + + def bring_eu_to_front(self) -> bool: + """Bring Entropia Universe window to front and focus it. + + Returns: + True if successful + """ + window_manager = self.services.get('window') + if not window_manager: + return False + + return window_manager.bring_eu_to_front() + # ========== Data Store Service ========== def register_data_service(self, data_store) -> None: