<commit_before>#!/usr/bin/env python
import sys
from gi.repository import Gtk, Gio, Gdk, GObject
from asciiplayback import *
from gtkasciiplayer import *

class ASCIImatorDesktop(Gtk.Window):
    def __init__(self):
        Gtk.Window.__init__(self, title="ASCIImator Desktop")
        self.set_default_size(400, 200)

        if len(sys.argv) > 1:
            self.filename = sys.argv[1]
            self.asciimation = ASCIImation(filename=self.filename)
            self.player = ASCIIPlayback(self.asciimation, speed=0)
        else:
            self.filename = ""
            self.asciimation = ASCIImation(font_family='monospace', size=[15, 3])
            self.asciimation.frames.append(Frame(text='\nNo file loaded!\n'))
            self.player = ASCIIPlayback(asciimation=self.asciimation, speed=0)

        print('\n'.join(Gtk.IconTheme().list_icons()))

        self.hsize_group = Gtk.SizeGroup(Gtk.SizeGroupMode.HORIZONTAL)

        right_box = self.main_content()
        left_box = self.sidebar()
        separator = Gtk.Separator(orientation=Gtk.Orientation.VERTICAL)

        hb = self.headerbar()
        self.set_titlebar(hb)

        box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
        box.pack_start(left_box, False, False, 0)
        box.pack_start(separator, False, False, 0)
        box.pack_start(right_box, True, True, 0)

        self.add(box)

    def headerbar(self):
        header = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)

        left_header = Gtk.HeaderBar()
        left_header.props.show_close_button = True
        right_header = Gtk.HeaderBar()
        right_header.props.show_close_button = True

        left_header.get_style_context().add_class("titlebar")
        left_header.get_style_context().add_class("titlebar-left")
        right_header.get_style_context().add_class("titlebar")
        right_header.get_style_context().add_class("titlebar-right")

        layout_desc = Gtk.Settings.get_default().props.gtk_decoration_layout
        tokens = layout_desc.split(":", 2)
        if tokens != None:
            right_header.props.decoration_layout = ":" + tokens[1]
            left_header.props.decoration_layout = tokens[0]

        self.title = Gtk.Label(self.filename)
        self.title.get_style_context().add_class("title")
        right_header.set_custom_title(self.title)

        button = Gtk.Button(image=Gtk.Image.new_from_gicon(Gio.ThemedIcon(
                            name="document-save-symbolic"),
                            Gtk.IconSize.BUTTON))
        right_header.pack_end(button)
        button = Gtk.Button(image=Gtk.Image.new_from_gicon(Gio.ThemedIcon(
                            name="document-open-symbolic"),
                            Gtk.IconSize.BUTTON))
        button.connect("clicked", self.do_open)
        right_header.pack_end(button)

        left_header.props.title = "ASCIImator Desktop"
        left_header.props.subtitle = "Offline ASCII Animator"

        header.pack_start(left_header, False, False, 0)
        header.pack_start(Gtk.Separator(orientation=Gtk.Orientation.VERTICAL),
                          False, False, 0)
        header.pack_start(right_header, True, True, 0)
        
        self.hsize_group.add_widget(left_header)

        return header

    def sidebar(self):
        left = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)

        ab = Gtk.ActionBar()
        ab.set_center_widget(self.stack_switcher)
        left.pack_end(ab, False, False, 0)



        self.hsize_group.add_widget(left)

        return left

    def main_content(self):
        stack = Gtk.Stack()
        stack.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT_RIGHT)
        stack.set_transition_duration(250)

        self.stack_switcher = Gtk.StackSwitcher()
        self.stack_switcher.set_stack(stack)

        #### Edit panel ####
        edit = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)

        edit_window = Gtk.ScrolledWindow()
        label = Gtk.Label()
        label.set_markup("<big>Edit coming soon...</big>")
        edit_window.add(label)
        edit.pack_start(edit_window, True, True, 0)

        ab = Gtk.ActionBar()
        ab_buttons = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
        Gtk.StyleContext.add_class(ab_buttons.get_style_context(), "linked")

        button = Gtk.Button(image=Gtk.Image.new_from_gicon(Gio.ThemedIcon(
                            name="edit-undo-symbolic"),
                            Gtk.IconSize.BUTTON))
        ab_buttons.add(button)
        button = Gtk.Button(image=Gtk.Image.new_from_gicon(Gio.ThemedIcon(
                            name="edit-redo-symbolic"),<commit_msg>Adding more to the mockup<commit_after>#!/usr/bin/env python
import sys
from gi.repository import Gtk, Gio, Gdk, GObject
from asciiplayback import *
from gtkasciiplayer import *

class ASCIImatorDesktop(Gtk.Window):
    def __init__(self):
        Gtk.Window.__init__(self, title="ASCIImator Desktop")
        self.set_default_size(400, 200)

        if len(sys.argv) > 1:
            self.filename = sys.argv[1]
            self.asciimation = ASCIImation(filename=self.filename)
            self.player = ASCIIPlayback(self.asciimation, speed=0)
        else:
            self.filename = ""
            self.asciimation = ASCIImation(font_family='monospace', size=[15, 3])
            self.asciimation.frames.append(Frame(text='\nNo file loaded!\n'))
            self.player = ASCIIPlayback(asciimation=self.asciimation, speed=0)

#        print('\n'.join(Gtk.IconTheme().list_icons()))

        self.hsize_group = Gtk.SizeGroup(Gtk.SizeGroupMode.HORIZONTAL)

        right_box = self.main_content()
        left_box = self.sidebar()
        separator = Gtk.Separator(orientation=Gtk.Orientation.VERTICAL)

        hb = self.headerbar()
        self.set_titlebar(hb)

        box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
        box.pack_start(left_box, False, False, 0)
        box.pack_start(separator, False, False, 0)
        box.pack_start(right_box, True, True, 0)

        self.add(box)

    def headerbar(self):
        header = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)

        left_header = Gtk.HeaderBar()
        left_header.props.show_close_button = True
        right_header = Gtk.HeaderBar()
        right_header.props.show_close_button = True

        left_header.get_style_context().add_class("titlebar")
        left_header.get_style_context().add_class("titlebar-left")
        right_header.get_style_context().add_class("titlebar")
        right_header.get_style_context().add_class("titlebar-right")

        layout_desc = Gtk.Settings.get_default().props.gtk_decoration_layout
        tokens = layout_desc.split(":", 2)
        if tokens != None:
            right_header.props.decoration_layout = ":" + tokens[1]
            left_header.props.decoration_layout = tokens[0]

        self.title = Gtk.Label(self.filename)
        self.title.get_style_context().add_class("title")
        right_header.set_custom_title(self.title)

        button = Gtk.Button(image=Gtk.Image.new_from_gicon(Gio.ThemedIcon(
                            name="document-save-symbolic"),
                            Gtk.IconSize.BUTTON))
        right_header.pack_end(button)
        button = Gtk.Button(image=Gtk.Image.new_from_gicon(Gio.ThemedIcon(
                            name="document-open-symbolic"),
                            Gtk.IconSize.BUTTON))
        button.connect("clicked", self.do_open)
        right_header.pack_end(button)

        left_header.props.title = "ASCIImator Desktop"
        left_header.props.subtitle = "Offline ASCII Animator"

        header.pack_start(left_header, False, False, 0)
        header.pack_start(Gtk.Separator(orientation=Gtk.Orientation.VERTICAL),
                          False, False, 0)
        header.pack_start(right_header, True, True, 0)
        
        self.hsize_group.add_widget(left_header)

        return header

    def sidebar(self):
        left = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)

        expander_scroll = Gtk.ScrolledWindow()
        expander_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)

        expander = Gtk.Expander()
        expander.props.use_markup = True
        expander.props.label = "<big>View</big>"
        view = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        view.add(Gtk.Switch())
        view.add(Gtk.SpinButton.new_with_range(0, 1000, 5))
        view.add(Gtk.FontButton())
        view.add(Gtk.SpinButton.new_with_range(1, 1000, 1))
        view.add(Gtk.SpinButton.new_with_range(1, 1000, 1))
        expander.add(view)
        expander.set_expanded(True)
        expander_box.add(expander)

        expander = Gtk.Expander()
        expander.props.use_markup = True
        expander.props.label = "<big>Color</big>"
        expander.add(Gtk.ColorButton())
        expander_box.add(expander)

        expander = Gtk.Expander()
        expander.props.use_markup = True
        expander.props.label = "<big>Frame</big>"
        expander.add(Gtk.FontButton())
        expander_box.add(expander)

        expander = Gtk.Expander()
        expander.props.use_markup = True
        expander.props.label = "<big>Layer</big>"
        expander.add(Gtk.FontButton())
        expander_box.add(expander)

        expander = Gtk.Expander()
        expander.props.use_markup = True
        expander.props.label = "<big>Replace</big>"
        expander.add(Gtk.FontButton())
        expander_box.add(expander)

        expander_scroll.add(expander_box)
        left.pack_start(expander_scroll, True, True, 0)

        ab = Gtk.ActionBar()
        ab.set_center_widget(self.stack_switcher)
        left.pack_end(ab, False, False, 0)

        self.hsize_group.add_widget(left)

        return left

    def main_content(self):
        stack = Gtk.Stack()
        stack.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT_RIGHT)
        stack.set_transition_duration(250)

        self.stack_switcher = Gtk.StackSwitcher()
        self.stack_switcher.set_stack(stack)

        #### Edit panel ####
        edit = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)

        edit_window = Gtk.ScrolledWindow()
        edit_flow = Gtk.FlowBox()
        edit_flow.set_selection_mode(Gtk.SelectionMode.MULTIPLE)
        label = Gtk.Label()
        label.set_markup("<big>Edit coming soon...</big>")
        edit_flow.add(label)
        label = Gtk.Label()
        label.set_markup("<big>Edit coming soon...</big>")
        edit_flow.add(label)
        label = Gtk.Label()
        label.set_markup("<big>Edit coming soon...</big>")
        edit_flow.add(label)
        label = Gtk.Label()
        label.set_markup("<big>Edit coming soon...</big>")
        edit_flow.add(label)
        label = Gtk.Label()
        label.set_markup("<big>Edit coming soon...</big>")
        edit_flow.add(label)
        label = Gtk.Label()
        label.set_markup("<big>Edit coming soon...</big>")
        edit_flow.add(label)
        label = Gtk.Label()
        label.set_markup("<big>Edit coming soon...</big>")
        edit_flow.add(label)
        edit_window.add(edit_flow)
        edit.pack_start(edit_window, True, True, 0)

        ab = Gtk.ActionBar()
        ab_buttons = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
        Gtk.StyleContext.add_class(ab_buttons.get_style_context(), "linked")

        button = Gtk.Button(image=Gtk.Image.new_from_gicon(Gio.ThemedIcon(
                            name="edit-undo-symbolic"),
                            Gtk.IconSize.BUTTON))
        ab_buttons.add(button)
        button = Gtk.Button(image=Gtk.Image.new_from_gicon(Gio.ThemedIcon(
                            name="edit-redo-symbolic"),
{'fraction_non_alphanumeric': 0.11741063793398324, 'fraction_numerical': 0.0062425175303574484, 'mean_word_length': 2.4827278141751044, 'pattern_counts': {'":': 4, '<': 29, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6312475', 'n_tokens_mistral': 3845, 'n_tokens_neox': 3699, 'n_words': 494}