# Path: debugger/enums.py
# class ProcessState(Enum):
#     """
#     Represents the debugged process' state.
#     """
#     Attaching = 3
#     Connected = 2
#     Crashed = 8
#     Detached = 9
#     Exited = 10
#     Invalid = 0
#     Launching = 4
#     Running = 6
#     Stepping = 7
#     Stopped = 5
#     Suspended = 11
#     Unloaded = 1
# 
# Path: debugger/util.py
# class EventBroadcaster(object):
#     """
#     Object that broadcasts event to it's listeners.
# 
#     Evety broadcaster represents a single event type.
#     """
#     def __init__(self):
#         self.listeners = []
# 
#     def notify(self, *args, **kwargs):
#         """
#         Notifies all listeners that an event has occured.
#         @param args: arbitraty arguments that will be passed to the listeners
#         """
#         map(lambda listener: listener(*args, **kwargs), self.listeners)
# 
#     def subscribe(self, listener):
#         """
#         Subscribes an event listener, who will receive events from the
#         broadcaster.
#         @type listener: function
#         """
#         self.listeners.append(listener)
# 
#     def unsubscribe(self, listener):
#         """
#         Unsubscribes an event listener.
#         It will no longer receive events after he unsubscribes.
#         @param listener: function
#         """
#         self.listeners.remove(listener)
# 
#     def clear(self):
#         """
#         Removes all event listeners.
#         """
#         self.listeners = []
# 
#     def redirect(self, broadcaster):
#         """
#         Redirects this broadcaster to the given broadcaster.
# 
#         All events fired by this broadcaster will be also delivered to the
#         given broadcaster.
#         @type broadcaster: EventBroadcaster
#         """
#         self.subscribe(broadcaster.notify)
# 
#     def __call__(self, *args, **kwargs):
#         self.notify(*args, **kwargs)


from gi.repository import Gtk
from debugger.enums import ProcessState
from debugger.util import EventBroadcaster
from gui_util import require_gui_thread, run_on_gui
import re
                return (address, int(address, 16))


class AddressInput(Gtk.Box):
    def __init__(self):
        Gtk.Box.__init__(self)

        self.set_orientation(Gtk.Orientation.VERTICAL)

        self.label_row = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0)

        self.label = Gtk.Label().new("Hex address or expression")
        self.label_row.pack_start(self.label, False, False, 0)

        self.input_row = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0)

        self.address_input = Gtk.Entry()
        self.address_input.set_editable(True)

        self.confirm_button = Gtk.Button()
        self.confirm_button.set_label("Load")

        self.input_row.pack_start(self.address_input, False, False, 0)
        self.input_row.pack_start(self.confirm_button, False, False, 0)

        self.pack_start(self.label_row, False, False, 2)
        self.pack_start(self.input_row, False, False, 0)

        self.set_margin_left(10)


# Path: debugger/enums.py
# class ProcessState(Enum):
#     """
#     Represents the debugged process' state.
#     """
#     Attaching = 3
#     Connected = 2
#     Crashed = 8
#     Detached = 9
#     Exited = 10
#     Invalid = 0
#     Launching = 4
#     Running = 6
#     Stepping = 7
#     Stopped = 5
#     Suspended = 11
#     Unloaded = 1
# 
# Path: debugger/util.py
# class EventBroadcaster(object):
#     """
#     Object that broadcasts event to it's listeners.
# 
#     Evety broadcaster represents a single event type.
#     """
#     def __init__(self):
#         self.listeners = []
# 
#     def notify(self, *args, **kwargs):
#         """
#         Notifies all listeners that an event has occured.
#         @param args: arbitraty arguments that will be passed to the listeners
#         """
#         map(lambda listener: listener(*args, **kwargs), self.listeners)
# 
#     def subscribe(self, listener):
#         """
#         Subscribes an event listener, who will receive events from the
#         broadcaster.
#         @type listener: function
#         """
#         self.listeners.append(listener)
# 
#     def unsubscribe(self, listener):
#         """
#         Unsubscribes an event listener.
#         It will no longer receive events after he unsubscribes.
#         @param listener: function
#         """
#         self.listeners.remove(listener)
# 
#     def clear(self):
#         """
#         Removes all event listeners.
#         """
#         self.listeners = []
# 
#     def redirect(self, broadcaster):
#         """
#         Redirects this broadcaster to the given broadcaster.
# 
#         All events fired by this broadcaster will be also delivered to the
#         given broadcaster.
#         @type broadcaster: EventBroadcaster
#         """
#         self.subscribe(broadcaster.notify)
# 
#     def __call__(self, *args, **kwargs):
#         self.notify(*args, **kwargs)


# Path: gui/memory_view.py
from gi.repository import Gtk
from debugger.enums import ProcessState
from debugger.util import EventBroadcaster
from gui_util import require_gui_thread, run_on_gui
import re

                return (address, int(address, 16))


class AddressInput(Gtk.Box):
    def __init__(self):
        Gtk.Box.__init__(self)

        self.set_orientation(Gtk.Orientation.VERTICAL)

        self.label_row = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0)

        self.label = Gtk.Label().new("Hex address or expression")
        self.label_row.pack_start(self.label, False, False, 0)

        self.input_row = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0)

        self.address_input = Gtk.Entry()
        self.address_input.set_editable(True)

        self.confirm_button = Gtk.Button()
        self.confirm_button.set_label("Load")

        self.input_row.pack_start(self.address_input, False, False, 0)
        self.input_row.pack_start(self.confirm_button, False, False, 0)

        self.pack_start(self.label_row, False, False, 2)
        self.pack_start(self.input_row, False, False, 0)

        self.set_margin_left(10)


        self.on_address_selected = EventBroadcaster()