# Path: icons.py



import os
import sys
import platform
import traceback
import cPickle
import shutil
import string
import array
import struct
import codecs
import re
import functools
import bisect
import random, math, copy
import subprocess, shlex
import socket
import thread
import threading
import time
import StringIO
import textwrap
import ctypes
import tempfile
import zlib
import glob
import urllib2
import cgi
    import _winreg
import __builtin__
import collections
import global_vars
import i18n
import wx
import wx.lib.buttons as wxButtons
import  wx.lib.colourselect as  colourselect
import wxp
                    import avisynth_cffi as avisynth
                    import avisynth
            import pyavs
            import pyavs_avifile as pyavs #  VFW, not longer supported
                import _subprocess
from hashlib import md5
from wx import stc
from icons import AvsP_icon, next_icon, play_icon, pause_icon, external_icon, \
                  skip_icon, spin_icon, ok_icon, smile_icon, question_icon, \
                  rectangle_icon, dragdrop_cursor
        
        # Create the main subwindows
        if wx.VERSION < (2, 9):
            self.programSplitter = wx.SplitterWindow(self, wx.ID_ANY, style=wx.SP_NOBORDER)
        else:
            self.programSplitter = self
        self.mainSplitter = wx.SplitterWindow(self.programSplitter, wx.ID_ANY, style=wx.SP_3DSASH|wx.SP_NOBORDER|wx.SP_LIVE_UPDATE)
        if not self.separatevideowindow:
            parent = self.mainSplitter
        else:
            #~ self.videoDialog = wx.Dialog(self, wx.ID_ANY, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
            style=wx.DEFAULT_FRAME_STYLE|wx.WANTS_CHARS
            if self.options['previewontopofmain']:
                style = style|wx.FRAME_FLOAT_ON_PARENT
            if self.options['previewalwaysontop']:
                style = style|wx.STAY_ON_TOP
            self.videoDialog = wx.Frame(self, wx.ID_ANY,style=style)#, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
            if self.options['previewontopofmain']: # main window loses 'always on top' effect
                self.ToggleWindowStyle(wx.STAY_ON_TOP)
                self.ToggleWindowStyle(wx.STAY_ON_TOP)
            dimensions = self.options.get('dimensions2')
            if dimensions is not None and dimensions[0] > 0 and dimensions[1] > 0:
                self.videoDialog.SetDimensions(*dimensions)
                # Move the window if it's offscreen
                size = self.videoDialog.GetSize()
                pos = self.videoDialog.GetPosition()
                wC, hC = wx.ScreenDC().GetSize()
                #~ if (pos[0]+size[0]>wC) or (pos[1]+size[1]>hC):
                if (pos[0]+50>wC) or (pos[1]+50>hC):
                    self.videoDialog.Center()

# Path: icons.py



# Path: avsp.py
import os
import sys
import platform
import traceback
import cPickle
import shutil
import string
import array
import struct
import codecs
import re
import functools
import bisect
import random, math, copy
import subprocess, shlex
import socket
import thread
import threading
import time
import StringIO
import textwrap
import ctypes
import tempfile
import zlib
import glob
import urllib2
import cgi
    import _winreg
import __builtin__
import collections
import global_vars
import i18n
import wx
import wx.lib.buttons as wxButtons
import  wx.lib.colourselect as  colourselect
import wxp
                    import avisynth_cffi as avisynth
                    import avisynth
            import pyavs
            import pyavs_avifile as pyavs #  VFW, not longer supported
                import _subprocess
from hashlib import md5
from wx import stc
from icons import AvsP_icon, next_icon, play_icon, pause_icon, external_icon, \
                  skip_icon, spin_icon, ok_icon, smile_icon, question_icon, \
                  rectangle_icon, dragdrop_cursor

        
        # Create the main subwindows
        if wx.VERSION < (2, 9):
            self.programSplitter = wx.SplitterWindow(self, wx.ID_ANY, style=wx.SP_NOBORDER)
        else:
            self.programSplitter = self
        self.mainSplitter = wx.SplitterWindow(self.programSplitter, wx.ID_ANY, style=wx.SP_3DSASH|wx.SP_NOBORDER|wx.SP_LIVE_UPDATE)
        if not self.separatevideowindow:
            parent = self.mainSplitter
        else:
            #~ self.videoDialog = wx.Dialog(self, wx.ID_ANY, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
            style=wx.DEFAULT_FRAME_STYLE|wx.WANTS_CHARS
            if self.options['previewontopofmain']:
                style = style|wx.FRAME_FLOAT_ON_PARENT
            if self.options['previewalwaysontop']:
                style = style|wx.STAY_ON_TOP
            self.videoDialog = wx.Frame(self, wx.ID_ANY,style=style)#, style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
            if self.options['previewontopofmain']: # main window loses 'always on top' effect
                self.ToggleWindowStyle(wx.STAY_ON_TOP)
                self.ToggleWindowStyle(wx.STAY_ON_TOP)
            dimensions = self.options.get('dimensions2')
            if dimensions is not None and dimensions[0] > 0 and dimensions[1] > 0:
                self.videoDialog.SetDimensions(*dimensions)
                # Move the window if it's offscreen
                size = self.videoDialog.GetSize()
                pos = self.videoDialog.GetPosition()
                wC, hC = wx.ScreenDC().GetSize()
                #~ if (pos[0]+size[0]>wC) or (pos[1]+size[1]>hC):
                if (pos[0]+50>wC) or (pos[1]+50>hC):
                    self.videoDialog.Center()

            self.videoDialog.SetIcon(AvsP_icon.getIcon())