Example #1
0
def text(texto, posx, posy, color, size):
    font = pygame.font.Font(util.get_font("normal"), size)
    output = pygame.font.Font.render(font, texto, 1, color)
    output_rect = output.get_rect()
    output_rect.centerx = posx
    output_rect.centery = posy
    return output, output_rect
Example #2
0
def train_screen():
    global menu
    font = util.get_font("titles")
    font2 = util.get_font("normal")
    text_wait, wait_rect =\
        util.text_format("WAIT", font, 75, util.white)
    text_wait2, wait_rect2 =\
        util.text_format("Training model....", font2, 35, util.white)
    text_wait3, wait_rect3 =\
        util.text_format("Using backend: BigML", font2, 20, util.white)

    while menu == util.TRAINING_SCREEN:
        screen.fill(util.blue)
        screen.blit(text_wait, (util.WIDTH / 2 - (wait_rect[2] / 2), 60))
        screen.blit(text_wait2, (util.WIDTH / 2 - (wait_rect2[2] / 2), 220))
        screen.blit(text_wait3, (util.WIDTH / 2 - (wait_rect3[2] / 2), 270))
        pygame.display.update()
        clock.tick(util.FPS)
Example #3
0
def game_menu(game):
    global menu
    # Selected menu option
    selected = util.SELECTED_AUTO
    font = util.get_font("titles")
    pygame.display.set_caption("Pygame ML games")
    while menu == util.MENU_PONG or menu == util.MENU_RACING:
        for event in pygame.event.get():
            menu, selected = games_menu_event(event, menu, selected, game)
        # Menu options text
        screen.fill(util.blue)
        title, title_rect =\
            util.text_format(util.GAME_NAMES[game], font, 80, util.yellow)

        text_auto, auto_rect =\
            util.text_format("Auto Play", font, 75, util.black)
        text_train, start_rect =\
            util.text_format("Train again", font, 75, util.black)
        text_quit, quit_rect =\
            util.text_format("Back to menu", font, 75, util.black)
        # Selected menu option in white
        if selected == util.SELECTED_AUTO:
            text_auto, auto_rect =\
                util.text_format("Auto Play", font, 75, util.white)
        if selected == util.SELECTED_TRAIN:
            text_train, start_rect =\
                util.text_format("Train again", font, 75, util.white)
        if selected == util.SELECTED_BACK:
            text_quit, quit_rect =\
                util.text_format("Back to menu", font, 75, util.white)
        # Draws text
        screen.blit(title, (util.WIDTH / 2 - (title_rect[2] / 2), 80))
        screen.blit(text_auto, (util.WIDTH / 2 - (auto_rect[2] / 2), 230))
        screen.blit(text_train, (util.WIDTH / 2 - (start_rect[2] / 2), 290))
        screen.blit(text_quit, (util.WIDTH / 2 - (quit_rect[2] / 2), 350))
        pygame.display.update()
        clock.tick(util.FPS)
Example #4
0
def main_menu():
    global menu
    selected = util.SELECTED_PONG  # Menu selected option
    pygame.display.set_caption("Pygame ML games")
    while menu == util.MENU_MAIN:
        # Check events
        for event in pygame.event.get():
            menu, selected = main_menu_event(event, pygame, menu, selected)
        # Main Menu UI
        screen.fill(util.blue)
        font = util.get_font("titles")
        # Menu options text
        title, title_rect =\
            util.text_format("Pygame ML games", font, 80, util.yellow)
        text_pong, pong_rect =\
            util.text_format("Pong", font, 75, util.black)
        text_racing, racing_rect =\
            util.text_format("Racing", font, 75, util.black)
        text_quit, quit_rect =\
            util.text_format("Quit", font, 75, util.black)
        # Selected menu option in white
        if selected == util.SELECTED_PONG:
            text_pong, pong_rect =\
                util.text_format("Pong", font, 75, util.white)
        elif selected == util.SELECTED_RACING:
            text_racing, racing_rect =\
                util.text_format("Racing", font, 75, util.white)
        elif selected == util.SELECTED_QUIT:
            text_quit, quit_rect =\
                util.text_format("Quit", font, 75, util.white)
        # Draw all texts
        screen.blit(title, (util.WIDTH / 2 - (title_rect[2] / 2), 80))
        screen.blit(text_pong, (util.WIDTH / 2 - (pong_rect[2] / 2), 220))
        screen.blit(text_racing, (util.WIDTH / 2 - (racing_rect[2] / 2), 290))
        screen.blit(text_quit, (util.WIDTH / 2 - (quit_rect[2] / 2), 360))
        pygame.display.update()
        clock.tick(util.FPS)
Example #5
0
def create_style_tree():
    from styles import Style
    
    root = Style(None, -1, 'Global Style', None, 
        util.get_font(), 10, False, False, False, 
        (0,0,0), (255,255,255))
        
    style = Style(root, 0, name='Application Styles')
    parent = style
    Style(parent, stc.STC_STYLE_BRACELIGHT, 'Brace (Matched)')
    Style(parent, stc.STC_STYLE_BRACEBAD, 'Brace (Unmatched)')
    #Style(parent, stc.STC_STYLE_CALLTIP, 'Calltip')
    Style(parent, stc.STC_STYLE_CONTROLCHAR, 'Control Character')
    Style(parent, stc.STC_STYLE_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_STYLE_INDENTGUIDE, 'Indentation Guides')
    Style(parent, stc.STC_STYLE_LINENUMBER, 'Line Number Margin')
    
    # ADA
    ada = Style(root, name='ADA', preview='ADA Base Style')
    parent = ada
    Style(parent, stc.STC_ADA_CHARACTER, 'Character')
    Style(parent, stc.STC_ADA_CHARACTEREOL, 'Character EOL')
    Style(parent, stc.STC_ADA_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_ADA_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_ADA_DELIMITER, 'Delimiter')
    Style(parent, stc.STC_ADA_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_ADA_ILLEGAL, 'Illegal')
    Style(parent, stc.STC_ADA_LABEL, 'Label')
    Style(parent, stc.STC_ADA_NUMBER, 'Number')
    Style(parent, stc.STC_ADA_STRING, 'String')
    Style(parent, stc.STC_ADA_STRINGEOL, 'String EOL')
    Style(parent, stc.STC_ADA_WORD, 'Keyword')

    # Assembly
    asm = Style(root, name='Assembly', preview='Assembly Base Style')
    parent = asm
    Style(parent, stc.STC_ASM_CHARACTER, 'Character')
    Style(parent, stc.STC_ASM_COMMENT, 'Comment')
    Style(parent, stc.STC_ASM_COMMENTBLOCK, 'Comment Block')
    Style(parent, stc.STC_ASM_CPUINSTRUCTION, 'Cpu Instruction')
    Style(parent, stc.STC_ASM_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_ASM_DIRECTIVE, 'Directive')
    Style(parent, stc.STC_ASM_DIRECTIVEOPERAND, 'Directiveoperand')
    Style(parent, stc.STC_ASM_EXTINSTRUCTION, 'Ext Instruction')
    Style(parent, stc.STC_ASM_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_ASM_MATHINSTRUCTION, 'Math Instruction')
    Style(parent, stc.STC_ASM_NUMBER, 'Number')
    Style(parent, stc.STC_ASM_OPERATOR, 'Operator')
    Style(parent, stc.STC_ASM_REGISTER, 'Register')
    Style(parent, stc.STC_ASM_STRING, 'String')
    Style(parent, stc.STC_ASM_STRINGEOL, 'String EOL')

    # Batch
    bat = Style(root, name='Batch', preview='Batch Base Style')
    parent = bat
    Style(parent, stc.STC_BAT_COMMAND, 'Command')
    Style(parent, stc.STC_BAT_COMMENT, 'Comment')
    Style(parent, stc.STC_BAT_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_BAT_HIDE, 'Hide')
    Style(parent, stc.STC_BAT_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_BAT_LABEL, 'Label')
    Style(parent, stc.STC_BAT_OPERATOR, 'Operator')
    Style(parent, stc.STC_BAT_WORD, 'Keyword')
    
    # Caml
    caml = Style(root, name='Caml', preview='Caml Base Style')
    parent = caml
    Style(parent, stc.STC_CAML_CHAR, 'Char')
    Style(parent, stc.STC_CAML_COMMENT, 'Comment')
    Style(parent, stc.STC_CAML_COMMENT1, 'Comment1')
    Style(parent, stc.STC_CAML_COMMENT2, 'Comment2')
    Style(parent, stc.STC_CAML_COMMENT3, 'Comment3')
    Style(parent, stc.STC_CAML_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_CAML_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_CAML_KEYWORD, 'Keyword')
    Style(parent, stc.STC_CAML_KEYWORD2, 'Keyword2')
    Style(parent, stc.STC_CAML_KEYWORD3, 'Keyword3')
    Style(parent, stc.STC_CAML_LINENUM, 'Linenum')
    Style(parent, stc.STC_CAML_NUMBER, 'Number')
    Style(parent, stc.STC_CAML_OPERATOR, 'Operator')
    Style(parent, stc.STC_CAML_STRING, 'String')
    Style(parent, stc.STC_CAML_TAGNAME, 'Tagname')
    
    # Conf
    conf = Style(root, name='Conf', preview='Conf Base Style')
    parent = conf
    Style(parent, stc.STC_CONF_COMMENT, 'Comment')
    Style(parent, stc.STC_CONF_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_CONF_DIRECTIVE, 'Directive')
    Style(parent, stc.STC_CONF_EXTENSION, 'Extension')
    Style(parent, stc.STC_CONF_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_CONF_IP, 'IP')
    Style(parent, stc.STC_CONF_NUMBER, 'Number')
    Style(parent, stc.STC_CONF_OPERATOR, 'Operator')
    Style(parent, stc.STC_CONF_PARAMETER, 'Parameter')
    Style(parent, stc.STC_CONF_STRING, 'String')

    # CSS
    css = Style(root, name='CSS', preview='CSS Base Style')
    parent = css
    Style(parent, stc.STC_CSS_ATTRIBUTE, 'Attribute')
    Style(parent, stc.STC_CSS_CLASS, 'Class')
    Style(parent, stc.STC_CSS_COMMENT, 'Comment')
    Style(parent, stc.STC_CSS_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_CSS_DIRECTIVE, 'Directive')
    Style(parent, stc.STC_CSS_DOUBLESTRING, 'Doublestring')
    Style(parent, stc.STC_CSS_ID, 'Id')
    Style(parent, stc.STC_CSS_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_CSS_IDENTIFIER2, 'Identifier2')
    Style(parent, stc.STC_CSS_IMPORTANT, 'Important')
    Style(parent, stc.STC_CSS_OPERATOR, 'Operator')
    Style(parent, stc.STC_CSS_PSEUDOCLASS, 'Pseudoclass')
    Style(parent, stc.STC_CSS_SINGLESTRING, 'Singlestring')
    Style(parent, stc.STC_CSS_TAG, 'Tag')
    Style(parent, stc.STC_CSS_VALUE, 'Value')

    # C++
    c = Style(root, name='C++', preview='C++ Base Style')
    parent = c
    Style(parent, stc.STC_C_CHARACTER, 'Character')
    Style(parent, stc.STC_C_COMMENT, 'Comment')
    Style(parent, stc.STC_C_COMMENTDOC, 'Commentdoc')
    Style(parent, stc.STC_C_COMMENTDOCKEYWORD, 'Commentdockeyword')
    Style(parent, stc.STC_C_COMMENTDOCKEYWORDERROR, 'Commentdockeyworderror')
    Style(parent, stc.STC_C_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_C_COMMENTLINEDOC, 'Commentlinedoc')
    Style(parent, stc.STC_C_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_C_GLOBALCLASS, 'Globalclass')
    Style(parent, stc.STC_C_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_C_NUMBER, 'Number')
    Style(parent, stc.STC_C_OPERATOR, 'Operator')
    Style(parent, stc.STC_C_PREPROCESSOR, 'Preprocessor')
    Style(parent, stc.STC_C_REGEX, 'Regex')
    Style(parent, stc.STC_C_STRING, 'String')
    Style(parent, stc.STC_C_STRINGEOL, 'String EOL')
    Style(parent, stc.STC_C_UUID, 'Uuid')
    Style(parent, stc.STC_C_VERBATIM, 'Verbatim')
    Style(parent, stc.STC_C_WORD, 'Keyword')
    Style(parent, stc.STC_C_WORD2, 'Keyword 2')
    
    # Diff
    diff = Style(root, name='Diff', preview='Diff Base Style')
    parent = diff
    Style(parent, stc.STC_DIFF_ADDED, 'Added')
    Style(parent, stc.STC_DIFF_COMMAND, 'Command')
    Style(parent, stc.STC_DIFF_COMMENT, 'Comment')
    Style(parent, stc.STC_DIFF_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_DIFF_DELETED, 'Deleted')
    Style(parent, stc.STC_DIFF_HEADER, 'Header')
    Style(parent, stc.STC_DIFF_POSITION, 'Position')
    
    # Eiffel
    eiffel = Style(root, name='Eiffel', preview='Eiffel Base Style')
    parent = eiffel
    Style(parent, stc.STC_EIFFEL_CHARACTER, 'Character')
    Style(parent, stc.STC_EIFFEL_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_EIFFEL_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_EIFFEL_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_EIFFEL_NUMBER, 'Number')
    Style(parent, stc.STC_EIFFEL_OPERATOR, 'Operator')
    Style(parent, stc.STC_EIFFEL_STRING, 'String')
    Style(parent, stc.STC_EIFFEL_STRINGEOL, 'String EOL')
    Style(parent, stc.STC_EIFFEL_WORD, 'Keyword')
    
    # Erlang
    erlang = Style(root, name='Erlang', preview='Erlang Base Style')
    parent = erlang
    Style(parent, stc.STC_ERLANG_ATOM, 'Atom')
    Style(parent, stc.STC_ERLANG_CHARACTER, 'Character')
    Style(parent, stc.STC_ERLANG_COMMENT, 'Comment')
    Style(parent, stc.STC_ERLANG_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_ERLANG_KEYWORD, 'Keyword')
    Style(parent, stc.STC_ERLANG_MACRO, 'Macro')
    Style(parent, stc.STC_ERLANG_NUMBER, 'Number')
    Style(parent, stc.STC_ERLANG_OPERATOR, 'Operator')
    Style(parent, stc.STC_ERLANG_RECORD, 'Record')
    Style(parent, stc.STC_ERLANG_SEPARATOR, 'Separator')
    Style(parent, stc.STC_ERLANG_STRING, 'String')
    Style(parent, stc.STC_ERLANG_UNKNOWN, 'Unknown')
    Style(parent, stc.STC_ERLANG_VARIABLE, 'Variable')
    
    # Forth
    forth = Style(root, name='Forth', preview='Forth Base Style')
    parent = forth
    Style(parent, stc.STC_FORTH_COMMENT, 'Comment')
    Style(parent, stc.STC_FORTH_CONTROL, 'Control')
    Style(parent, stc.STC_FORTH_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_FORTH_DEFWORD, 'Defword')
    Style(parent, stc.STC_FORTH_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_FORTH_KEYWORD, 'Keyword')
    Style(parent, stc.STC_FORTH_LOCALE, 'Locale')
    Style(parent, stc.STC_FORTH_NUMBER, 'Number')
    Style(parent, stc.STC_FORTH_PREWORD1, 'Preword1')
    Style(parent, stc.STC_FORTH_PREWORD2, 'Preword2')
    Style(parent, stc.STC_FORTH_STRING, 'String')
    
    # Fortran
    f = Style(root, name='Fortran', preview='Fortran Base Style')
    parent = f
    Style(parent, stc.STC_F_COMMENT, 'Comment')
    Style(parent, stc.STC_F_CONTINUATION, 'Continuation')
    Style(parent, stc.STC_F_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_F_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_F_LABEL, 'Label')
    Style(parent, stc.STC_F_NUMBER, 'Number')
    Style(parent, stc.STC_F_OPERATOR, 'Operator')
    Style(parent, stc.STC_F_OPERATOR2, 'Operator2')
    Style(parent, stc.STC_F_PREPROCESSOR, 'Preprocessor')
    Style(parent, stc.STC_F_STRING1, 'String1')
    Style(parent, stc.STC_F_STRING2, 'String2')
    Style(parent, stc.STC_F_STRINGEOL, 'String EOL')
    Style(parent, stc.STC_F_WORD, 'Keyword')
    Style(parent, stc.STC_F_WORD2, 'Keyword 2')
    Style(parent, stc.STC_F_WORD3, 'Keyword 3')
    
    # Haskell
    ha = Style(root, name='Haskell', preview='Haskell Base Style')
    parent = ha
    Style(parent, stc.STC_HA_CAPITAL, 'Capital')
    Style(parent, stc.STC_HA_CHARACTER, 'Character')
    Style(parent, stc.STC_HA_CLASS, 'Class')
    Style(parent, stc.STC_HA_COMMENTBLOCK, 'Comment Block')
    Style(parent, stc.STC_HA_COMMENTBLOCK2, 'Commentblock2')
    Style(parent, stc.STC_HA_COMMENTBLOCK3, 'Commentblock3')
    Style(parent, stc.STC_HA_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_HA_DATA, 'Data')
    Style(parent, stc.STC_HA_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_HA_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_HA_IMPORT, 'Import')
    Style(parent, stc.STC_HA_INSTANCE, 'Instance')
    Style(parent, stc.STC_HA_KEYWORD, 'Keyword')
    Style(parent, stc.STC_HA_MODULE, 'Module')
    Style(parent, stc.STC_HA_NUMBER, 'Number')
    Style(parent, stc.STC_HA_OPERATOR, 'Operator')
    Style(parent, stc.STC_HA_STRING, 'String')
    
    '''
    # ASP JavaScript
    hja = Style(root, name='JavaScript', preview='ASP JavaScript Base Style')
    parent = hja
    Style(parent, stc.STC_HJA_COMMENT, 'Comment')
    Style(parent, stc.STC_HJA_COMMENTDOC, 'Commentdoc')
    Style(parent, stc.STC_HJA_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_HJA_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_HJA_DOUBLESTRING, 'Doublestring')
    Style(parent, stc.STC_HJA_KEYWORD, 'Keyword')
    Style(parent, stc.STC_HJA_NUMBER, 'Number')
    Style(parent, stc.STC_HJA_REGEX, 'Regex')
    Style(parent, stc.STC_HJA_SINGLESTRING, 'Singlestring')
    Style(parent, stc.STC_HJA_START, 'Start')
    Style(parent, stc.STC_HJA_STRINGEOL, 'String EOL')
    Style(parent, stc.STC_HJA_SYMBOLS, 'Symbols')
    Style(parent, stc.STC_HJA_WORD, 'Keyword')
    
    # ASP VBScript
    hba = Style(root, name='ASP VBScript', preview='ASP VBScript Base Style')
    parent = hba
    Style(parent, stc.STC_HBA_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_HBA_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_HBA_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_HBA_NUMBER, 'Number')
    Style(parent, stc.STC_HBA_START, 'Start')
    Style(parent, stc.STC_HBA_STRING, 'String')
    Style(parent, stc.STC_HBA_STRINGEOL, 'String EOL')
    Style(parent, stc.STC_HBA_WORD, 'Keyword')
    
    # ASP Python
    hpa = Style(root, name='ASP Python', preview='ASP Python Base Style')
    parent = hpa
    Style(parent, stc.STC_HPA_CHARACTER, 'Character')
    Style(parent, stc.STC_HPA_CLASSNAME, 'Classname')
    Style(parent, stc.STC_HPA_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_HPA_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_HPA_DEFNAME, 'Defname')
    Style(parent, stc.STC_HPA_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_HPA_NUMBER, 'Number')
    Style(parent, stc.STC_HPA_OPERATOR, 'Operator')
    Style(parent, stc.STC_HPA_START, 'Start')
    Style(parent, stc.STC_HPA_STRING, 'String')
    Style(parent, stc.STC_HPA_TRIPLE, 'Triple')
    Style(parent, stc.STC_HPA_TRIPLEDOUBLE, 'Tripledouble')
    Style(parent, stc.STC_HPA_WORD, 'Keyword')
    
    # HTML Python
    hp = Style(root, name='HTML Python', preview='HTML Python Base Style')
    parent = hp
    Style(parent, stc.STC_HP_CHARACTER, 'Character')
    Style(parent, stc.STC_HP_CLASSNAME, 'Classname')
    Style(parent, stc.STC_HP_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_HP_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_HP_DEFNAME, 'Defname')
    Style(parent, stc.STC_HP_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_HP_NUMBER, 'Number')
    Style(parent, stc.STC_HP_OPERATOR, 'Operator')
    Style(parent, stc.STC_HP_START, 'Start')
    Style(parent, stc.STC_HP_STRING, 'String')
    Style(parent, stc.STC_HP_TRIPLE, 'Triple')
    Style(parent, stc.STC_HP_TRIPLEDOUBLE, 'Tripledouble')
    Style(parent, stc.STC_HP_WORD, 'Keyword')
    '''
    
    # HTML VBScript
    hb = Style(root, name='HTML VBScript', preview='HTML VBScript Base Style')
    parent = hb
    Style(parent, stc.STC_HB_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_HB_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_HB_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_HB_NUMBER, 'Number')
    Style(parent, stc.STC_HB_START, 'Start')
    Style(parent, stc.STC_HB_STRING, 'String')
    Style(parent, stc.STC_HB_STRINGEOL, 'String EOL')
    Style(parent, stc.STC_HB_WORD, 'Keyword')
    
    # HTML JavaScript
    hj = Style(root, name='HTML JavaScript', preview='HTML JavaScript Base Style')
    parent = hj
    Style(parent, stc.STC_HJ_COMMENT, 'Comment')
    Style(parent, stc.STC_HJ_COMMENTDOC, 'Commentdoc')
    Style(parent, stc.STC_HJ_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_HJ_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_HJ_DOUBLESTRING, 'Doublestring')
    Style(parent, stc.STC_HJ_KEYWORD, 'Keyword')
    Style(parent, stc.STC_HJ_NUMBER, 'Number')
    Style(parent, stc.STC_HJ_REGEX, 'Regex')
    Style(parent, stc.STC_HJ_SINGLESTRING, 'Singlestring')
    Style(parent, stc.STC_HJ_START, 'Start')
    Style(parent, stc.STC_HJ_STRINGEOL, 'String EOL')
    Style(parent, stc.STC_HJ_SYMBOLS, 'Symbols')
    Style(parent, stc.STC_HJ_WORD, 'Keyword')
    
    # PHP
    hphp = Style(root, name='PHP', preview='PHP Base Style')
    parent = hphp
    Style(parent, stc.STC_HPHP_COMMENT, 'Comment')
    Style(parent, stc.STC_HPHP_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_HPHP_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_HPHP_HSTRING, 'Hstring')
    Style(parent, stc.STC_HPHP_NUMBER, 'Number')
    Style(parent, stc.STC_HPHP_OPERATOR, 'Operator')
    Style(parent, stc.STC_HPHP_SIMPLESTRING, 'Simplestring')
    Style(parent, stc.STC_HPHP_VARIABLE, 'Variable')
    Style(parent, stc.STC_HPHP_WORD, 'Keyword')
    
    # HTML
    h = Style(root, name='HTML', preview='HTML Base Style')
    parent = h
    Style(parent, stc.STC_H_ASP, 'Asp')
    Style(parent, stc.STC_H_ASPAT, 'Aspat')
    Style(parent, stc.STC_H_ATTRIBUTE, 'Attribute')
    Style(parent, stc.STC_H_ATTRIBUTEUNKNOWN, 'Attributeunknown')
    Style(parent, stc.STC_H_CDATA, 'Cdata')
    Style(parent, stc.STC_H_COMMENT, 'Comment')
    Style(parent, stc.STC_H_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_H_DOUBLESTRING, 'Doublestring')
    Style(parent, stc.STC_H_ENTITY, 'Entity')
    Style(parent, stc.STC_H_NUMBER, 'Number')
    Style(parent, stc.STC_H_OTHER, 'Other')
    Style(parent, stc.STC_H_QUESTION, 'Question')
    Style(parent, stc.STC_H_SCRIPT, 'Script')
    Style(parent, stc.STC_H_SINGLESTRING, 'Singlestring')
    Style(parent, stc.STC_H_TAG, 'Tag')
    Style(parent, stc.STC_H_TAGEND, 'Tagend')
    Style(parent, stc.STC_H_TAGUNKNOWN, 'Tagunknown')
    Style(parent, stc.STC_H_VALUE, 'Value')
    Style(parent, stc.STC_H_XCCOMMENT, 'Xccomment')
    Style(parent, stc.STC_H_XMLEND, 'Xmlend')
    Style(parent, stc.STC_H_XMLSTART, 'Xmlstart')
    
    # InnoSetup
    inno = Style(root, name='InnoSetup', preview='InnoSetup Base Style')
    parent = inno
    Style(parent, stc.STC_INNO_COMMENT, 'Comment')
    Style(parent, stc.STC_INNO_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_INNO_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_INNO_KEYWORD, 'Keyword')
    Style(parent, stc.STC_INNO_PARAMETER, 'Parameter')
    Style(parent, stc.STC_INNO_PREPROC, 'Preproc')
    Style(parent, stc.STC_INNO_SECTION, 'Section')
    
    # Lisp
    lisp = Style(root, name='Lisp', preview='Lisp Base Style')
    parent = lisp
    Style(parent, stc.STC_LISP_COMMENT, 'Comment')
    Style(parent, stc.STC_LISP_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_LISP_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_LISP_KEYWORD, 'Keyword')
    Style(parent, stc.STC_LISP_NUMBER, 'Number')
    Style(parent, stc.STC_LISP_OPERATOR, 'Operator')
    Style(parent, stc.STC_LISP_SPECIAL, 'Special')
    Style(parent, stc.STC_LISP_STRING, 'String')
    Style(parent, stc.STC_LISP_STRINGEOL, 'String EOL')
    Style(parent, stc.STC_LISP_SYMBOL, 'Symbol')
    
    # Lua
    lua = Style(root, name='Lua', preview='Lua Base Style')
    parent = lua
    Style(parent, stc.STC_LUA_CHARACTER, 'Character')
    Style(parent, stc.STC_LUA_COMMENT, 'Comment')
    Style(parent, stc.STC_LUA_COMMENTDOC, 'Commentdoc')
    Style(parent, stc.STC_LUA_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_LUA_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_LUA_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_LUA_LITERALSTRING, 'Literalstring')
    Style(parent, stc.STC_LUA_NUMBER, 'Number')
    Style(parent, stc.STC_LUA_OPERATOR, 'Operator')
    Style(parent, stc.STC_LUA_PREPROCESSOR, 'Preprocessor')
    Style(parent, stc.STC_LUA_STRING, 'String')
    Style(parent, stc.STC_LUA_STRINGEOL, 'String EOL')
    Style(parent, stc.STC_LUA_WORD, 'Keyword')
    Style(parent, stc.STC_LUA_WORD2, 'Keyword 2')
    Style(parent, stc.STC_LUA_WORD3, 'Keyword 3')
    Style(parent, stc.STC_LUA_WORD4, 'Keyword 4')
    Style(parent, stc.STC_LUA_WORD5, 'Word5')
    Style(parent, stc.STC_LUA_WORD6, 'Word6')
    Style(parent, stc.STC_LUA_WORD7, 'Word7')
    Style(parent, stc.STC_LUA_WORD8, 'Word8')
    
    # Makefile
    make = Style(root, name='Makefile', preview='Makefile Base Style')
    parent = make
    Style(parent, stc.STC_MAKE_COMMENT, 'Comment')
    Style(parent, stc.STC_MAKE_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_MAKE_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_MAKE_IDEOL, 'ID EOL')
    Style(parent, stc.STC_MAKE_OPERATOR, 'Operator')
    Style(parent, stc.STC_MAKE_PREPROCESSOR, 'Preprocessor')
    Style(parent, stc.STC_MAKE_TARGET, 'Target')
    
    # MATLAB
    matlab = Style(root, name='MATLAB', preview='MATLAB Base Style')
    parent = matlab
    Style(parent, stc.STC_MATLAB_COMMAND, 'Command')
    Style(parent, stc.STC_MATLAB_COMMENT, 'Comment')
    Style(parent, stc.STC_MATLAB_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_MATLAB_DOUBLEQUOTESTRING, 'Doublequotestring')
    Style(parent, stc.STC_MATLAB_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_MATLAB_KEYWORD, 'Keyword')
    Style(parent, stc.STC_MATLAB_NUMBER, 'Number')
    Style(parent, stc.STC_MATLAB_OPERATOR, 'Operator')
    Style(parent, stc.STC_MATLAB_STRING, 'String')
    
    # MSSQL
    mssql = Style(root, name='MSSQL', preview='MSSQL Base Style')
    parent = mssql
    Style(parent, stc.STC_MSSQL_COMMENT, 'Comment')
    Style(parent, stc.STC_MSSQL_DATATYPE, 'Datatype')
    Style(parent, stc.STC_MSSQL_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_MSSQL_FUNCTION, 'Function')
    Style(parent, stc.STC_MSSQL_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_MSSQL_NUMBER, 'Number')
    Style(parent, stc.STC_MSSQL_OPERATOR, 'Operator')
    Style(parent, stc.STC_MSSQL_STATEMENT, 'Statement')
    Style(parent, stc.STC_MSSQL_STRING, 'String')
    Style(parent, stc.STC_MSSQL_SYSTABLE, 'Systable')
    Style(parent, stc.STC_MSSQL_VARIABLE, 'Variable')
    
    # Crontab
    nncrontab = Style(root, name='Crontab', preview='Crontab Base Style')
    parent = nncrontab
    Style(parent, stc.STC_NNCRONTAB_ASTERISK, 'Asterisk')
    Style(parent, stc.STC_NNCRONTAB_COMMENT, 'Comment')
    Style(parent, stc.STC_NNCRONTAB_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_NNCRONTAB_ENVIRONMENT, 'Environment')
    Style(parent, stc.STC_NNCRONTAB_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_NNCRONTAB_KEYWORD, 'Keyword')
    Style(parent, stc.STC_NNCRONTAB_MODIFIER, 'Modifier')
    Style(parent, stc.STC_NNCRONTAB_NUMBER, 'Number')
    Style(parent, stc.STC_NNCRONTAB_SECTION, 'Section')
    Style(parent, stc.STC_NNCRONTAB_STRING, 'String')
    Style(parent, stc.STC_NNCRONTAB_TASK, 'Task')
    
    # NSIS
    nsis = Style(root, name='NSIS', preview='NSIS Base Style')
    parent = nsis
    Style(parent, stc.STC_NSIS_COMMENT, 'Comment')
    Style(parent, stc.STC_NSIS_COMMENTBOX, 'Commentbox')
    Style(parent, stc.STC_NSIS_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_NSIS_FUNCTION, 'Function')
    Style(parent, stc.STC_NSIS_FUNCTIONDEF, 'Functiondef')
    Style(parent, stc.STC_NSIS_IFDEFINEDEF, 'Ifdefinedef')
    Style(parent, stc.STC_NSIS_LABEL, 'Label')
    Style(parent, stc.STC_NSIS_MACRODEF, 'Macrodef')
    Style(parent, stc.STC_NSIS_NUMBER, 'Number')
    Style(parent, stc.STC_NSIS_PAGEEX, 'Pageex')
    Style(parent, stc.STC_NSIS_SECTIONDEF, 'Sectiondef')
    Style(parent, stc.STC_NSIS_SECTIONGROUP, 'Sectiongroup')
    Style(parent, stc.STC_NSIS_STRINGDQ, 'Stringdq')
    Style(parent, stc.STC_NSIS_STRINGLQ, 'Stringlq')
    Style(parent, stc.STC_NSIS_STRINGRQ, 'Stringrq')
    Style(parent, stc.STC_NSIS_STRINGVAR, 'Stringvar')
    Style(parent, stc.STC_NSIS_SUBSECTIONDEF, 'Subsectiondef')
    Style(parent, stc.STC_NSIS_USERDEFINED, 'Userdefined')
    Style(parent, stc.STC_NSIS_VARIABLE, 'Variable')
    
    # Perl
    pl = Style(root, name='Perl', preview='Perl Base Style')
    parent = pl
    Style(parent, stc.STC_PL_ARRAY, 'Array')
    Style(parent, stc.STC_PL_BACKTICKS, 'Backticks')
    Style(parent, stc.STC_PL_CHARACTER, 'Character')
    Style(parent, stc.STC_PL_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_PL_DATASECTION, 'Datasection')
    Style(parent, stc.STC_PL_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_PL_ERROR, 'Error')
    Style(parent, stc.STC_PL_HASH, 'Hash')
    Style(parent, stc.STC_PL_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_PL_LONGQUOTE, 'Longquote')
    Style(parent, stc.STC_PL_NUMBER, 'Number')
    Style(parent, stc.STC_PL_OPERATOR, 'Operator')
    Style(parent, stc.STC_PL_POD, 'Pod')
    Style(parent, stc.STC_PL_PREPROCESSOR, 'Preprocessor')
    Style(parent, stc.STC_PL_PUNCTUATION, 'Punctuation')
    Style(parent, stc.STC_PL_REGEX, 'Regex')
    Style(parent, stc.STC_PL_REGSUBST, 'Regsubst')
    Style(parent, stc.STC_PL_SCALAR, 'Scalar')
    Style(parent, stc.STC_PL_STRING, 'String')
    Style(parent, stc.STC_PL_SYMBOLTABLE, 'Symboltable')
    Style(parent, stc.STC_PL_WORD, 'Keyword')
    
    # Properties
    props = Style(root, name='Properties', preview='Properties Base Style')
    parent = props
    Style(parent, stc.STC_PROPS_ASSIGNMENT, 'Assignment')
    Style(parent, stc.STC_PROPS_COMMENT, 'Comment')
    Style(parent, stc.STC_PROPS_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_PROPS_DEFVAL, 'Defval')
    Style(parent, stc.STC_PROPS_KEY, 'Key')
    Style(parent, stc.STC_PROPS_SECTION, 'Section')
    
    # Python
    p = Style(root, name='Python', preview='Python Base Style')
    parent = p
    Style(parent, stc.STC_P_CHARACTER, 'Character')
    Style(parent, stc.STC_P_CLASSNAME, 'Classname')
    Style(parent, stc.STC_P_COMMENTBLOCK, 'Comment Block')
    Style(parent, stc.STC_P_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_P_DECORATOR, 'Decorator')
    Style(parent, stc.STC_P_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_P_DEFNAME, 'Defname')
    Style(parent, stc.STC_P_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_P_NUMBER, 'Number')
    Style(parent, stc.STC_P_OPERATOR, 'Operator')
    Style(parent, stc.STC_P_STRING, 'String')
    Style(parent, stc.STC_P_STRINGEOL, 'String EOL')
    Style(parent, stc.STC_P_TRIPLE, 'Triple')
    Style(parent, stc.STC_P_TRIPLEDOUBLE, 'Tripledouble')
    Style(parent, stc.STC_P_WORD, 'Keyword')
    Style(parent, stc.STC_P_WORD2, 'Keyword 2')
    
    # Ruby
    rb = Style(root, name='Ruby', preview='Ruby Base Style')
    parent = rb
    Style(parent, stc.STC_RB_BACKTICKS, 'Backticks')
    Style(parent, stc.STC_RB_CHARACTER, 'Character')
    Style(parent, stc.STC_RB_CLASSNAME, 'Classname')
    Style(parent, stc.STC_RB_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_RB_DATASECTION, 'Datasection')
    Style(parent, stc.STC_RB_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_RB_DEFNAME, 'Defname')
    Style(parent, stc.STC_RB_ERROR, 'Error')
    Style(parent, stc.STC_RB_GLOBAL, 'Global')
    Style(parent, stc.STC_RB_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_RB_NUMBER, 'Number')
    Style(parent, stc.STC_RB_OPERATOR, 'Operator')
    Style(parent, stc.STC_RB_POD, 'Pod')
    Style(parent, stc.STC_RB_REGEX, 'Regex')
    Style(parent, stc.STC_RB_STDERR, 'Stderr')
    Style(parent, stc.STC_RB_STDIN, 'Stdin')
    Style(parent, stc.STC_RB_STDOUT, 'Stdout')
    Style(parent, stc.STC_RB_STRING, 'String')
    Style(parent, stc.STC_RB_SYMBOL, 'Symbol')
    Style(parent, stc.STC_RB_WORD, 'Keyword')
    
    # SH
    sh = Style(root, name='SH', preview='SH Base Style')
    parent = sh
    Style(parent, stc.STC_SH_BACKTICKS, 'Backticks')
    Style(parent, stc.STC_SH_CHARACTER, 'Character')
    Style(parent, stc.STC_SH_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_SH_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_SH_ERROR, 'Error')
    Style(parent, stc.STC_SH_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_SH_NUMBER, 'Number')
    Style(parent, stc.STC_SH_OPERATOR, 'Operator')
    Style(parent, stc.STC_SH_PARAM, 'Param')
    Style(parent, stc.STC_SH_SCALAR, 'Scalar')
    Style(parent, stc.STC_SH_STRING, 'String')
    Style(parent, stc.STC_SH_WORD, 'Keyword')
    
    # SQL
    sql = Style(root, name='SQL', preview='SQL Base Style')
    parent = sql
    Style(parent, stc.STC_SQL_CHARACTER, 'Character')
    Style(parent, stc.STC_SQL_COMMENT, 'Comment')
    Style(parent, stc.STC_SQL_COMMENTDOC, 'Commentdoc')
    Style(parent, stc.STC_SQL_COMMENTDOCKEYWORD, 'Commentdockeyword')
    Style(parent, stc.STC_SQL_COMMENTDOCKEYWORDERROR, 'Commentdockeyworderror')
    Style(parent, stc.STC_SQL_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_SQL_COMMENTLINEDOC, 'Commentlinedoc')
    Style(parent, stc.STC_SQL_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_SQL_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_SQL_NUMBER, 'Number')
    Style(parent, stc.STC_SQL_OPERATOR, 'Operator')
    Style(parent, stc.STC_SQL_QUOTEDIDENTIFIER, 'Quotedidentifier')
    Style(parent, stc.STC_SQL_SQLPLUS, 'Sqlplus')
    Style(parent, stc.STC_SQL_STRING, 'String')
    Style(parent, stc.STC_SQL_USER1, 'User1')
    Style(parent, stc.STC_SQL_USER2, 'User2')
    Style(parent, stc.STC_SQL_USER3, 'User3')
    Style(parent, stc.STC_SQL_USER4, 'User4')
    Style(parent, stc.STC_SQL_WORD, 'Keyword')
    Style(parent, stc.STC_SQL_WORD2, 'Keyword 2')
    
    # Tcl
    tcl = Style(root, name='Tcl', preview='Tcl Base Style')
    parent = tcl
    Style(parent, stc.STC_TCL_COMMENT, 'Comment')
    Style(parent, stc.STC_TCL_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_TCL_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_TCL_EXPAND, 'Expand')
    Style(parent, stc.STC_TCL_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_TCL_MODIFIER, 'Modifier')
    Style(parent, stc.STC_TCL_NUMBER, 'Number')
    Style(parent, stc.STC_TCL_OPERATOR, 'Operator')
    Style(parent, stc.STC_TCL_SUBSTITUTION, 'Substitution')
    Style(parent, stc.STC_TCL_WORD, 'Keyword')
    Style(parent, stc.STC_TCL_WORD2, 'Keyword 2')
    Style(parent, stc.STC_TCL_WORD3, 'Keyword 3')
    Style(parent, stc.STC_TCL_WORD4, 'Keyword 4')
    Style(parent, stc.STC_TCL_WORD5, 'Word5')
    Style(parent, stc.STC_TCL_WORD6, 'Word6')
    Style(parent, stc.STC_TCL_WORD7, 'Word7')
    Style(parent, stc.STC_TCL_WORD8, 'Word8')
    
    # TeX
    tex = Style(root, name='TeX', preview='TeX Base Style')
    parent = tex
    Style(parent, stc.STC_TEX_COMMAND, 'Command')
    Style(parent, stc.STC_TEX_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_TEX_GROUP, 'Group')
    Style(parent, stc.STC_TEX_SPECIAL, 'Special')
    Style(parent, stc.STC_TEX_SYMBOL, 'Symbol')
    Style(parent, stc.STC_TEX_TEXT, 'Text')
    
    # VHDL
    vhdl = Style(root, name='VHDL', preview='VHDL Base Style')
    parent = vhdl
    Style(parent, stc.STC_VHDL_ATTRIBUTE, 'Attribute')
    Style(parent, stc.STC_VHDL_COMMENT, 'Comment')
    Style(parent, stc.STC_VHDL_COMMENTLINEBANG, 'Commentlinebang')
    Style(parent, stc.STC_VHDL_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_VHDL_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_VHDL_KEYWORD, 'Keyword')
    Style(parent, stc.STC_VHDL_NUMBER, 'Number')
    Style(parent, stc.STC_VHDL_OPERATOR, 'Operator')
    Style(parent, stc.STC_VHDL_STDFUNCTION, 'Stdfunction')
    Style(parent, stc.STC_VHDL_STDOPERATOR, 'Stdoperator')
    Style(parent, stc.STC_VHDL_STDPACKAGE, 'Stdpackage')
    Style(parent, stc.STC_VHDL_STDTYPE, 'Stdtype')
    Style(parent, stc.STC_VHDL_STRING, 'String')
    Style(parent, stc.STC_VHDL_STRINGEOL, 'String EOL')
    Style(parent, stc.STC_VHDL_USERWORD, 'Userword')
    
    # Verilog
    v = Style(root, name='Verilog', preview='Verilog Base Style')
    parent = v
    Style(parent, stc.STC_V_COMMENT, 'Comment')
    Style(parent, stc.STC_V_COMMENTLINE, 'Comment Line')
    Style(parent, stc.STC_V_COMMENTLINEBANG, 'Commentlinebang')
    Style(parent, stc.STC_V_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_V_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_V_NUMBER, 'Number')
    Style(parent, stc.STC_V_OPERATOR, 'Operator')
    Style(parent, stc.STC_V_PREPROCESSOR, 'Preprocessor')
    Style(parent, stc.STC_V_STRING, 'String')
    Style(parent, stc.STC_V_STRINGEOL, 'String EOL')
    Style(parent, stc.STC_V_USER, 'User')
    Style(parent, stc.STC_V_WORD, 'Keyword')
    Style(parent, stc.STC_V_WORD2, 'Keyword 2')
    Style(parent, stc.STC_V_WORD3, 'Keyword 3')
    
    # YAML
    yaml = Style(root, name='YAML', preview='YAML Base Style')
    parent = yaml
    Style(parent, stc.STC_YAML_COMMENT, 'Comment')
    Style(parent, stc.STC_YAML_DEFAULT, 'Whitespace')
    Style(parent, stc.STC_YAML_DOCUMENT, 'Document')
    Style(parent, stc.STC_YAML_ERROR, 'Error')
    Style(parent, stc.STC_YAML_IDENTIFIER, 'Identifier')
    Style(parent, stc.STC_YAML_KEYWORD, 'Keyword')
    Style(parent, stc.STC_YAML_NUMBER, 'Number')
    Style(parent, stc.STC_YAML_REFERENCE, 'Reference')
    Style(parent, stc.STC_YAML_TEXT, 'Text')
    
    return root
    
Example #6
0
def create_base_style():
    base_style = Style(None, stc.STC_STYLE_DEFAULT, 'Global Style', None, 
        util.get_font(), 10, False, False, False, 
        (0,0,0), (255,255,255))
    return base_style