Beispiel #1
0
    def __init__(self, core, textviews):
        super(StringsTextView,self).__init__(False, 1)

        #################################################################
        # Right Textview
        #################################################################

        self.uicore = core
        self.textviews = textviews

        self.press_coords = []

        # Use GtkSourceView to add eye candy :P
        # create buffer
        lm = gtksourceview2.LanguageManager()
        # Add ui dir to language paths
        paths = lm.get_search_path()
        paths.append(os.path.dirname(__file__) + os.sep + 'data' + os.sep)
        lm.set_search_path(paths)
        self.buffer = gtksourceview2.Buffer()
        self.buffer.create_tag("green-background", background="green", foreground="black")
        self.buffer.set_data('languages-manager', lm)
        self.view = gtksourceview2.View(self.buffer)
        self.view.connect("button-press-event", self._get_press)
        self.view.connect("button-release-event", self._get_release)

        # FIXME options must be user selectable (statusbar)
        self.view.set_editable(False)
        self.view.set_highlight_current_line(True)
        # posible values: gtk.WRAP_NONE, gtk.WRAP_CHAR, gtk.WRAP_WORD...
        self.view.set_wrap_mode(gtk.WRAP_NONE)
        
        # setup view
        font_desc = pango.FontDescription('monospace 9')
        if font_desc:
            self.view.modify_font(font_desc)

        self.buffer.set_highlight_syntax(True)
        manager = self.buffer.get_data('languages-manager')
        language = manager.get_language('asm')
        self.buffer.set_language(language)

        self.mgr = gtksourceview2.style_scheme_manager_get_default()

        # Scrolled Window
        self.strings_scrolled_window = gtk.ScrolledWindow()
        self.strings_scrolled_window.set_shadow_type(gtk.SHADOW_ETCHED_IN)
        self.strings_scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.strings_scrolled_window.show()
        # Add Textview to Scrolled Window
        self.strings_scrolled_window.add(self.view)
        self.pack_start(self.strings_scrolled_window, expand=True, fill=True)

        # Create the search widget
        Searchable.__init__(self, self.view, small=True)

        # Used for code navidation on _search function
        self.match_start = None
        self.match_end = None
        self.search_string = ''
Beispiel #2
0
    def __init__(self, core, textviews):
        super(ReprTextView, self).__init__(False, 1)

        #################################################################
        # Right Textview
        #################################################################

        self.uicore = core
        self.textviews = textviews

        # Use GtkSourceView to add eye candy :P
        # create buffer
        lm = gtksourceview2.LanguageManager()
        # Add ui dir to language paths
        paths = lm.get_search_path()
        paths.append(os.path.dirname(__file__) + os.sep + 'data' + os.sep)
        lm.set_search_path(paths)
        self.buffer = gtksourceview2.Buffer()
        self.buffer.create_tag("green-background",
                               background="green",
                               foreground="black")
        self.buffer.set_data('languages-manager', lm)
        self.view = gtksourceview2.View(self.buffer)

        # FIXME options must be user selectable (statusbar)
        self.view.set_editable(False)
        self.view.set_highlight_current_line(True)
        # posible values: gtk.WRAP_NONE, gtk.WRAP_CHAR, gtk.WRAP_WORD...
        self.view.set_wrap_mode(gtk.WRAP_WORD)

        # setup view
        font_desc = pango.FontDescription('monospace 9')
        if font_desc:
            self.view.modify_font(font_desc)

        self.buffer.set_highlight_syntax(False)
        manager = self.buffer.get_data('languages-manager')
        language = manager.get_language('asm')
        self.buffer.set_language(language)

        self.mgr = gtksourceview2.style_scheme_manager_get_default()

        # Scrolled Window
        self.repr_scrolled_window = gtk.ScrolledWindow()
        self.repr_scrolled_window.set_shadow_type(gtk.SHADOW_ETCHED_IN)
        self.repr_scrolled_window.set_policy(gtk.POLICY_AUTOMATIC,
                                             gtk.POLICY_AUTOMATIC)
        self.repr_scrolled_window.show()
        # Add Textview to Scrolled Window
        self.repr_scrolled_window.add(self.view)
        self.pack_start(self.repr_scrolled_window, expand=True, fill=True)

        # Create the search widget
        Searchable.__init__(self, self.view, small=True)

        # Used for code navidation on _search function
        self.match_start = None
        self.match_end = None
        self.search_string = ''
Beispiel #3
0
    def __init__(self, core, textviews, main):
        super(RightTextView,self).__init__(False, 1)

        #################################################################
        # Right Textview
        #################################################################

        self.uicore = core
        self.main = main
        self.textviews = textviews

        self.seek_index = 0
        self.seeks = []
        self.marks = []
        self.press_coords = []

        #################################################
        # Move buttons
        self.move_buttons = self.create_seek_buttons()
        self.pack_start(self.move_buttons, False, False, 1)

        self.hbox = gtk.HBox(False, 0)

        # Use GtkSourceView to add eye candy :P
        # create buffer
        lm = gtksourceview2.LanguageManager()
        # Add ui dir to language paths
        paths = lm.get_search_path()
        paths.append(os.path.dirname(__file__) + os.sep + 'data' + os.sep)
        lm.set_search_path(paths)
        self.buffer = gtksourceview2.Buffer()
        self.buffer.set_data('languages-manager', lm)
        self.view = gtksourceview2.View(self.buffer)
        self.view.connect("button-press-event", self._get_press)
        self.view.connect("button-release-event", self._get_release)
        self.view.connect("key-release-event", self._cursor_moved)
        tooltip_handle = self.view.connect('motion-notify-event', self.call_tooltip)

        # FIXME options must be user selectable (statusbar)
        self.view.set_editable(False)
        self.view.set_highlight_current_line(True)
        # posible values: gtk.WRAP_NONE, gtk.WRAP_CHAR, gtk.WRAP_WORD...
        self.view.set_wrap_mode(gtk.WRAP_NONE)

        # setup view
        font_desc = pango.FontDescription('monospace 9')
        if font_desc:
            self.view.modify_font(font_desc)

        self.buffer.set_highlight_syntax(True)
        manager = self.buffer.get_data('languages-manager')
        if "ARM" in self.uicore.info.machine or "Thumb" in self.uicore.info.machine:
            language = manager.get_language('arm-asm')
        else:
            language = manager.get_language('asm')

        self.buffer.set_language(language)

        self.mgr = gtksourceview2.style_scheme_manager_get_default()

        # Scrolled Window
        self.right_scrolled_window = gtk.ScrolledWindow()
        self.right_scrolled_window.set_shadow_type(gtk.SHADOW_ETCHED_IN)
        self.right_scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.right_scrolled_window.show()
        # Add Textview to Scrolled Window
        self.right_scrolled_window.add(self.view)
        self.hbox.pack_start(self.right_scrolled_window, expand=True, fill=True)
        self.pack_start(self.hbox, expand=True, fill=True)

        # Create the search widget
        Searchable.__init__(self, self.view, small=True)

        self.high_word = HighWord(self.view)

        # Used for code navigation on _search function
        self.match_start = None
        self.match_end = None
        self.search_string = ''

        self.view.connect("populate-popup", self._populate_comments_menu)
Beispiel #4
0
    def __init__(self, main):
        super(RightTextView, self).__init__(False, 1)

        #################################################################
        # Right Textview
        #################################################################

        self.main = main
        self.uicore = self.main.uicore

        self.seek_index = 0
        self.seeks = []
        self.marks = []
        self.press_coords = []

        #################################################
        # Move buttons
        self.move_buttons = self.create_seek_buttons()
        self.pack_start(self.move_buttons, False, False, 1)

        self.hbox = Gtk.HBox(False, 0)

        self.buffer = GtkSource.Buffer()
        self.view = GtkSource.View.new_with_buffer(self.buffer)
        self.view.connect("button-press-event", self._get_press)
        self.view.connect("button-release-event", self._get_release)
        self.view.connect("key-release-event", self._cursor_moved)
        self.view.connect('motion-notify-event', self.call_tooltip)

        # FIXME options must be user selectable (statusbar)
        self.view.set_editable(False)
        self.view.set_highlight_current_line(True)
        # posible values: Gtk.WrapMode.NONE, Gtk.WrapMode.CHAR, Gtk.WrapMode.WORD...
        self.view.set_wrap_mode(Gtk.WrapMode.NONE)

        # setup view
        font_desc = Pango.FontDescription('monospace 9')
        if font_desc:
            self.view.modify_font(font_desc)

        self.buffer.set_highlight_syntax(True)
        if "ARM" in self.uicore.info.machine or "Thumb" in self.uicore.info.machine:
            language = self.main.lm.get_language('arm-asm')
        else:
            language = self.main.lm.get_language('asm')

        self.buffer.set_language(language)

        self.mgr = GtkSource.StyleSchemeManager.get_default()

        # Scrolled Window
        self.right_scrolled_window = Gtk.ScrolledWindow()
        self.right_scrolled_window.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        self.right_scrolled_window.set_policy(Gtk.PolicyType.AUTOMATIC,
                                              Gtk.PolicyType.AUTOMATIC)
        self.right_scrolled_window.show()
        # Add Textview to Scrolled Window
        self.right_scrolled_window.add(self.view)
        self.hbox.pack_start(self.right_scrolled_window, True, True, 0)
        self.pack_start(self.hbox, True, True, 0)

        # Create the search widget
        Searchable.__init__(self, self.view, small=True)

        self.high_word = HighWord(self.view)

        # Used for code navigation on _search function
        self.match_start = None
        self.match_end = None
        self.search_string = ''

        self.view.connect("populate-popup", self._populate_comments_menu)
Beispiel #5
0
    def __init__(self, main):
        super(RightTextView, self).__init__(False, 1)

        #################################################################
        # Right Textview
        #################################################################

        self.main = main
        self.uicore = self.main.uicore

        self.seek_index = 0
        self.seeks = []
        self.marks = []
        self.press_coords = []

        #################################################
        # Move buttons
        self.move_buttons = self.create_seek_buttons()
        self.pack_start(self.move_buttons, False, False, 1)

        self.hbox = Gtk.HBox(False, 0)

        self.buffer = GtkSource.Buffer()
        self.view = GtkSource.View.new_with_buffer(self.buffer)
        self.view.connect("button-press-event", self._get_press)
        self.view.connect("button-release-event", self._get_release)
        self.view.connect("key-release-event", self._cursor_moved)
        self.view.connect('motion-notify-event', self.call_tooltip)

        # FIXME options must be user selectable (statusbar)
        self.view.set_editable(False)
        self.view.set_highlight_current_line(True)
        # posible values: Gtk.WrapMode.NONE, Gtk.WrapMode.CHAR, Gtk.WrapMode.WORD...
        self.view.set_wrap_mode(Gtk.WrapMode.NONE)

        # setup view
        font_desc = Pango.FontDescription('monospace 9')
        if font_desc:
            self.view.modify_font(font_desc)

        self.buffer.set_highlight_syntax(True)
        if "ARM" in self.uicore.info.machine or "Thumb" in self.uicore.info.machine:
            language = self.main.lm.get_language('arm-asm')
        else:
            language = self.main.lm.get_language('asm')

        self.buffer.set_language(language)

        self.mgr = GtkSource.StyleSchemeManager.get_default()

        # Scrolled Window
        self.right_scrolled_window = Gtk.ScrolledWindow()
        self.right_scrolled_window.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
        self.right_scrolled_window.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        self.right_scrolled_window.show()
        # Add Textview to Scrolled Window
        self.right_scrolled_window.add(self.view)
        self.hbox.pack_start(self.right_scrolled_window, True, True, 0)
        self.pack_start(self.hbox, True, True, 0)

        # Create the search widget
        Searchable.__init__(self, self.view, small=True)

        self.high_word = HighWord(self.view)

        # Used for code navigation on _search function
        self.match_start = None
        self.match_end = None
        self.search_string = ''

        self.view.connect("populate-popup", self._populate_comments_menu)