From 61adc35bb0b120e8e9ee7cfba57defe417377fe4 Mon Sep 17 00:00:00 2001 From: Tim Warren Date: Wed, 15 Apr 2015 09:47:20 -0400 Subject: [PATCH] Load JSON files at compile time as C Strings --- Makefile | 12 +++++++- config/json2c.c | 66 ++++++++++++++++++++++++++++++++++++++++ config/languages.json | 55 +++++++++++++++++++++++++++++++++ config/scintilla.json | 60 ------------------------------------ config/themes.json | 5 +++ src/common.h | 2 -- src/settings/Config.cpp | 22 +++++--------- src/widgets/EditPane.cpp | 16 +++++++--- 8 files changed, 157 insertions(+), 81 deletions(-) create mode 100644 config/json2c.c create mode 100644 config/languages.json delete mode 100644 config/scintilla.json create mode 100644 config/themes.json diff --git a/Makefile b/Makefile index 9c092c3..a3dccdd 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,8 @@ SOURCES = $(wildcard include/**/*.cpp src/network/*.cpp src/settings/*.cpp inclu OBJECTS = $(patsubst %.cpp,%.o, $(SOURCES)) TARGET = build/Tyro.a +JSON_FILES = $(patsubst config/%.json,%.json, $(wildcard config/*.json)) + PROGRAM_SRC = $(wildcard src/*.cpp src/widgets/*.cpp) PROGRAM = build/Tyro PROGRAM_OBJECTS = $(patsubst %.cpp,%.o, $(PROGRAM_SRC)) @@ -17,10 +19,16 @@ CXXFLAGS = -Os TEST_SRC= $(wildcard tests/*.cpp) TESTS = $(patsubst %.cpp,%,$(TEST_SRC)) -all: build $(TARGET) $(PROGRAM) +all: build json_wrapper $(TARGET) $(PROGRAM) dev: CXXFLAGS= $(DEV_CXXFLAGS) dev: all + +json_wrapper: json_wrapper_build + $(foreach var, $(JSON_FILES), config/json2c config/$(var) $(patsubst %.json,config/%_json.h,$(var)) $(patsubst %.json,%_json,$(var));) + +json_wrapper_build: + $(CC) config/json2c.c -o config/json2c build: @mkdir -p build @@ -57,6 +65,8 @@ tests: $(TESTS) sh ./tests/runtests.sh clean: + rm config/json2c + rm config/*_json.h rm -f *.o rm -rf Tyro.app rm -rf build $(OBJECTS) $(PROGRAM) $(TARGET) $(TESTS) diff --git a/config/json2c.c b/config/json2c.c new file mode 100644 index 0000000..2785a8f --- /dev/null +++ b/config/json2c.c @@ -0,0 +1,66 @@ +/* + * bin2c: A Program to convert binary data into C source code + * Copyright 2004 by Adrian Prantl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + */ + +#include +#include + +char* self = 0; + +void usage() { + printf("Usage:\n%s input.bin output.h name\n\n", self); +} + +void bail_out(const char* s1, const char* s2) { + fprintf(stderr, "%s: FATAL ERROR:\n%s%s\n", self, s1, s2); + exit(1); +} + +int main(int argc, char** argv) { + FILE *fi, *fo; + int c, i; + + self = argv[0]; + + if (argc != 4) { + usage(); + return 0; + } + + if ((fi = fopen(argv[1], "rb")) == 0) + bail_out("Cannot open input file ", argv[1]); + + if ((fo = fopen(argv[2], "w")) == 0) + bail_out("Cannot open output file ", argv[2]); + + if ((c = fgetc(fi)) != EOF) { + fprintf(fo, "#ifndef %s_H\n", argv[3]); + fprintf(fo, "#define %s_H\n\n", argv[3]); + fprintf(fo, "const char %s[] = {\n", argv[3]); + fprintf(fo, c < 16 ? " 0x%02x" : " 0x%02x", c); + } + + i = 1; + while ((c = fgetc(fi)) != EOF) { + if (i < 12) + fprintf(fo, c < 16 ? ", 0x%02x" : ", 0x%02x", c); + else { + fprintf(fo, c < 16 ? ",\n 0x%02x" : ",\n 0x%02x", c); + i = 0; + } + i++; + } + fprintf(fo, "\n};\n\n"); + fprintf(fo, "#endif\n"); + + printf("converted %s\n", argv[1]); + + return 0; +} \ No newline at end of file diff --git a/config/languages.json b/config/languages.json new file mode 100644 index 0000000..0ccf342 --- /dev/null +++ b/config/languages.json @@ -0,0 +1,55 @@ +{ + "batch": { + "keywords": [ + "rem set if else exist errorlevel for in do break call copy chcp cd chdir choice cls country ctty date del erase dir echo exit goto loadfix loadhigh mkdir md move path pause prompt rename ren rmdir rd shift time type ver verify vol com con lpt nul defined not errorlevel cmdextversion" + ] + }, + "c": { + "keywords": [ + "if else switch case default break goto return for while do continue typedef sizeof NULL", + "void struct union enum char short int long double float signed unsigned const static extern auto register volatile" + ] + }, + "cpp": { + "keywords": [ + "alignof and and_eq bitand bitor break case catch compl const_cast continue default delete do dynamic_cast else false for goto if namespace new not not_eq nullptr operator or or_eq reinterpret_cast return sizeof static_assert static_cast switch this throw true try typedef typeid using while xor xor_eq NULL", + "alignas asm auto bool char char16_t char32_t class const constexpr decltype double enum explicit export extern final float friend inline int long mutable noexcept override private protected public register short signed static struct template thread_local typename union unsigned virtual void volatile wchar_t" + ] + }, + "js": { + "keywords": [ + "abstract boolean break byte case catch char class const continue debugger default delete do double else enum export extends final finally float for function goto if implements import in instanceof int interface long native new package private protected public return short static super switch synchronized this throw throws transient try typeof var void volatile while with true false prototype" + ] + }, + "php": { + "keywords": [ + "filesize filemtime ksort sort count shell_exec disk_free_space disk_total_space file_exists strip_tags htmlentities stripslashes mysql_real_escape_string session_start error_reporting define str_replace pathinfo date time version_compare sha1 sha1_file md5 md5_file ignore_user_abort and or xor __dir__ __method__ __namespace__ __file__ __line__ array as break case cfunction class const continue declare default die do echo else elseif empty enddeclare endfor endforeach endif endswitch endwhile eval exit extends for foreach function global if include include_once isset list new old_function print require require_once return static switch unset use var while __function__ __class__ php_version php_os default_include_path pear_install_dir pear_extension_dir php_extension_dir php_bindir php_libdir php_datadir php_sysconfdir php_localstatedir php_config_file_path php_output_handler_start php_output_handler_cont php_output_handler_end e_error e_recoverable_error e_warning e_parse e_notice e_core_error e_core_warning e_compile_error e_compile_warning e_user_error e_user_warning e_user_notice e_all true false bool boolean int integer float double real string array object resource null class extends parent stdclass directory __sleep __wakeup interface implements abstract public protected private printf print_r php_major_version php_minor_version php_release_version php_version_id php_extra_version php_zts php_debug php_maxpathlen php_sapi php_eol php_int_max php_int_size php_prefix php_mandir php_config_file_scan_dir php_shlib_suffix php_windows_version_major php_windows_version_minor php_windows_version_build php_windows_version_platform php_windows_version_sp_major php_windows_version_sp_minor php_windows_version_suitemask php_windows_version_producttype php_windows_nt_domain_controller php_windows_nt_server php_windows_nt_workstation e_deprecated e_user_deprecated e_strict __compiler_halt_offset__ extr_overwrite extr_skip extr_prefix_same extr_prefix_all extr_prefix_invalid extr_prefix_if_exists extr_if_exists sort_asc sort_desc sort_regular sort_numeric sort_string case_lower case_upper count_normal count_recursive assert_active assert_callback assert_bail assert_warning assert_quiet_eval connection_aborted connection_normal connection_timeout ini_user ini_perdir ini_system ini_all m_e m_log2e m_log10e m_ln2 m_ln10 m_pi m_pi_2 m_pi_4 m_1_pi m_2_pi m_2_sqrtpi m_sqrt2 m_sqrt1_2 crypt_salt_length crypt_std_des crypt_ext_des crypt_md5 crypt_blowfish directory_separator seek_set seek_cur seek_end lock_sh lock_ex lock_un lock_nb html_specialchars html_entities ent_compat ent_quotes ent_noquotes info_general info_credits info_configuration info_modules info_environment info_variables info_license info_all credits_group credits_general credits_sapi credits_modules credits_docs credits_fullpage credits_qa credits_all str_pad_left str_pad_right str_pad_both pathinfo_dirname pathinfo_basename pathinfo_extension path_separator char_max lc_ctype lc_numeric lc_time lc_collate lc_monetary lc_all lc_messages abday_1 abday_2 abday_3 abday_4 abday_5 abday_6 abday_7 day_1 day_2 day_3 day_4 day_5 day_6 day_7 abmon_1 abmon_2 abmon_3 abmon_4 abmon_5 abmon_6 abmon_7 abmon_8 abmon_9 abmon_10 abmon_11 abmon_12 mon_1 mon_2 mon_3 mon_4 mon_5 mon_6 mon_7 mon_8 mon_9 mon_10 mon_11 mon_12 am_str pm_str d_t_fmt d_fmt t_fmt t_fmt_ampm era era_year era_d_t_fmt era_d_fmt era_t_fmt alt_digits int_curr_symbol currency_symbol crncystr mon_decimal_point mon_thousands_sep mon_grouping positive_sign negative_sign int_frac_digits frac_digits p_cs_precedes p_sep_by_space n_cs_precedes n_sep_by_space p_sign_posn n_sign_posn decimal_point radixchar thousands_sep thousep grouping yesexpr noexpr yesstr nostr codeset log_emerg log_alert log_crit log_err log_warning log_notice log_info log_debug log_kern log_user log_mail log_daemon log_auth log_syslog log_lpr log_news log_uucp log_cron log_authpriv log_local0 log_local1 log_local2 log_local3 log_local4 log_local5 log_local6 log_local7 log_pid log_cons log_odelay log_ndelay log_nowait log_perror msql_connect msql_close msql msql_create_db msql_createdb msql_drop_db msql_drop_db msql_select_db msql_select_db msql_pconnect msql msql_create_db msql_createdb msql_drop_db msql_drop_db msql_select_db msql_select_db msql_db_query msql_list_dbs msql_list_fields msql_list_tables msql_query msql msql_affected_rows msql_data_seek msql_dbname msql_fetch_array msql_fetch_field msql_fetch_object msql_fetch_row msql_field_seek msql_field_table msql_field_flags msql_field_len msql_field_name msql_field_type msql_num_fields msql_num_rows msql_numfields msql_numrows msql_result mssql_connect mssql_query mssql_select_db mssql_close mssql_pconnect mssql_query mssql_select_db mssql_query mssql_data_seek mssql_fetch_array mssql_fetch_field mssql_fetch_object mssql_fetch_row mssql_field_length mssql_field_name mssql_field_seek mssql_field_type mssql_num_fields mssql_num_rows mssql_result mssql_free_result mysql_connect mysql_affected_rows mysql_change_user mysql_create_db mysql_data_seek mysql_db_name mysql_db_query mysql_drop_db mysql_errno mysql_error mysql_insert_id mysql_list_dbs mysql_list_fields mysql_list_tables mysql_query mysql_result mysql_select_db mysql_tablename mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_close mysql_pconnect mysql_affected_rows mysql_change_user mysql_create_db mysql_data_seek mysql_db_name mysql_db_query mysql_drop_db mysql_errno mysql_error mysql_insert_id mysql_list_dbs mysql_list_fields mysql_list_tables mysql_query mysql_result mysql_select_db mysql_tablename mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_db_query mysql_list_dbs mysql_list_fields mysql_list_processes mysql_list_tables mysql_query mysql_unbuffered_query mysql_data_seek mysql_db_name mysql_fetch_array mysql_fetch_assoc mysql_fetch_field mysql_fetch_lengths mysql_fetch_object mysql_fetch_row mysql_fetch_row mysql_field_flags mysql_field_name mysql_field_len mysql_field_seek mysql_field_table mysql_field_type mysql_num_fields mysql_num_rows mysql_result mysql_tablename mysql_free_result ocilogon ociplogon ocinlogon ocicommit ociserverversion ocinewcursor ociparse ocierror ocilogoff ocinewdescriptor ocirollback ocinewdescriptor ocirowcount ocidefinebyname ocibindbyname ociexecute ocinumcols ociresult ocifetch ocifetchinto ocifetchstatement ocicolumnisnull ocicolumnname ocicolumnsize ocicolumntype ocistatementtype ocierror ocifreestatement odbc_connect odbc_autocommit odbc_commit odbc_error odbc_errormsg odbc_exec odbc_tables odbc_tableprivileges odbc_do odbc_prepare odbc_columns odbc_columnprivileges odbc_procedurecolumns odbc_specialcolumns odbc_rollback odbc_setoption odbc_gettypeinfo odbc_primarykeys odbc_foreignkeys odbc_procedures odbc_statistics odbc_close odbc_pconnect odbc_autocommit odbc_commit odbc_error odbc_errormsg odbc_exec odbc_tables odbc_tableprivileges odbc_do odbc_prepare odbc_columns odbc_columnprivileges odbc_procedurecolumns odbc_specialcolumns odbc_rollback odbc_setoption odbc_gettypeinfo odbc_primarykeys odbc_foreignkeys odbc_procedures odbc_statistics odbc_prepare odbc_binmode odbc_cursor odbc_execute odbc_fetch_into odbc_fetch_row odbc_field_name odbc_field_num odbc_field_type odbc_field_len odbc_field_precision odbc_field_scale odbc_longreadlen odbc_num_fields odbc_num_rows odbc_result odbc_result_all odbc_setoption odbc_free_result openssl_get_privatekey openssl_get_publickey openssl_sign openssl_seal openssl_open openssl_verify openssl_free_key xml_parser_create xml_parser_create_ns xml_set_object xml_set_element_handler xml_set_character_data_handler xml_set_processing_instruction_handler xml_set_default_handler xml_set_unparsed_entity_decl_handler xml_set_notation_decl_handler xml_set_external_entity_ref_handler xml_parse xml_get_error_code xml_error_string xml_get_current_line_number xml_get_current_column_number xml_get_current_byte_index xml_parse_into_struct xml_parser_set_option xml_parser_get_option xml_parser_free gzopen gzeof gzgetc gzgets gzgetss gzpassthru gzputs gzread gzrewind gzseek gztell gzwrite gzclose bzopen bzerrno bzerror bzerrstr bzflush bzread bzwrite bzclose com_load com_invoke com_propget com_get com_propput com_set com_propput imagecreate imagecreatefromgd imagecreatefromgd2 imagecreatefromgd2part imagecreatefromgif imagecreatefromjpeg imagecreatefrompng imagecreatefromwbmp imagecreatefromstring imagecreatefromxbm imagecreatefromxpm imagecreatetruecolor imagerotate imagearc imagechar imagecharup imagecolorallocate imagecolorat imagecolorclosest imagecolorexact imagecolorresolve imagegammacorrect imagegammacorrect imagecolorset imagecolorsforindex imagecolorstotal imagecolortransparent imagecopy imagecopyresized imagedashedline imagefill imagefilledpolygon imagefilledrectangle imagefilltoborder imagegif imagepng imagejpeg imagewbmp imageinterlace imageline imagepolygon imagepstext imagerectangle imagerotate imagesetpixel imagestring imagestringup imagesx imagesy imagettftext imagefilledarc imageellipse imagefilledellipse imagecolorclosestalpha imagecolorexactalpha imagecolorresolvealpha imagecopymerge imagecopymergegray imagecopyresampled imagetruecolortopalette imagesetbrush imagesettile imagesetthickness image2wbmp imagealphablending imageantialias imagecolorallocatealpha imagecolorclosesthwb imagecolordeallocate imagecolormatch imagefilter imagefttext imagegd imagegd2 imageistruecolor imagelayereffect imagepalettecopy imagesavealpha imagesetstyle imagexbm imagedestroy imageloadfont imagechar imagecharup imagefontheight imagepsloadfont imagepstext imagepsslantfont imagepsextendfont imagepsencodefont imagepsbbox imagepsfreefont curl_copy_handle curl_init curl_copy_handle curl_errno curl_error curl_exec curl_getinfo curl_setopt curl_close dba_open dba_delete dba_exists dba_fetch dba_firstkey dba_insert dba_nextkey dba_optimize dba_replace dba_sync dba_close dba_popen dba_delete dba_exists dba_fetch dba_firstkey dba_insert dba_nextkey dba_optimize dba_replace dba_sync strstr strtoupper strtolower strpos explode implode closedir getdir floatval rtrim fwrite extension_loaded final catch clone goto instanceof namespace throw try trigger_error ftp_connect ftp_ssl_connect ftp_close ftp_login ftp_pwd ftp_cdup ftp_chdir ftp_mkdir ftp_rmdir ftp_nlist ftp_rawlist ftp_systype ftp_pasv ftp_get ftp_fget ftp_put ftp_fput ftp_size ftp_mdtm ftp_rename ftp_delete ftp_site ftp_alloc ftp_chmod ftp_exec ftp_get_option ftp_nb_continue ftp_nb_fget ftp_nb_fput ftp_nb_get ftp_nb_put ftp_raw ftp_set_option imap_open imap_close imap_append imap_body imap_check imap_createmailbox imap_delete imap_deletemailbox imap_expunge imap_fetchbody imap_fetchstructure imap_headerinfo imap_header imap_headers imap_listmailbox imap_getmailboxes imap_get_quota imap_status imap_listsubscribed imap_set_quota imap_set_quota imap_getsubscribed imap_mail_copy imap_mail_move imap_num_msg imap_num_recent imap_ping imap_renamemailbox imap_reopen imap_subscribe imap_undelete imap_unsubscribe imap_scanmailbox imap_mailboxmsginfo imap_fetchheader imap_uid imap_msgno imap_search imap_fetch_overview array_change_key_case array_chunk array_combine array_count_values array_diff array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill array_fill_keys array_filter array_flip array_intersect array_intersect_assoc array_intersect_key array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map array_merge array_merge_recursive array_multisort array_pad array_pop array_product array_push array_rand array_reduce array_replace array_replace_recursive array_reverse array_search array_shift array_slice array_splice array_sum array_udiff array_udiff_assoc array_udiff_uassoc array_uintersect array_uintersect_assoc array_uintersect_uassoc array_unique array_unshift array_values array_walk array_walk_recursive arrayaccess arrayiterator arrayobject fclose flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf fseek fsockopen fstat ftell __construct __destruct" + ] + }, + "perl": { + "keywords": [ + "NULL __FILE__ __LINE__ __PACKAGE__ __DATA__ __END__ AUTOLOAD BEGIN CORE DESTROY END EQ GE GT INIT LE LT NE CHECK abs accept alarm and atan2 bind binmode bless caller chdir chmod chomp chop chown chr chroot close closedir cmp connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eq eval exec exists exit exp fcntl fileno flock for foreach fork format formline ge getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst le length link listen local localtime lock log lstat lt m map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q qq qr quotemeta qu qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir s scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn while write x xor y" + ] + }, + "python": { + "keywords": [ + "and as assert break class continue def del elif else except exec False finally for from global if import in is lambda None not or pass print raise return triple True try while with yield" + ] + }, + "css": { + "keywords": [ + "-khtml-border-radius -khtml-opacity -khtml-background-clip -khtml-background-origin -khtml-background-size -khtml-border-top-left-radius -khtml-border-top-right-radius -khtml-border-bottom-right-radius -khtml-border-bottom-left-radius -moz-animation -moz-animation-delay -moz-animation-direction -moz-animation-duration -moz-animation-fill-mode -moz-animation-iteration-count -moz-animation-name -moz-animation-play-state -moz-animation-timing-function -moz-appearance -moz-background-clip -moz-background-inline-policy -moz-background-origin -moz-background-size -moz-binding -moz-border-bottom-colors -moz-border-end -moz-border-end-color -moz-border-end-style -moz-border-end-width -moz-border-image -moz-border-left-colors -moz-border-radius -moz-border-radius-bottomleft -moz-border-radius-bottomright -moz-border-radius-topleft -moz-border-radius-topright -moz-border-right-colors -moz-border-start -moz-border-start-color -moz-border-start-style -moz-border-start-width -moz-border-top-colors -moz-box-align -moz-box-direction -moz-box-flex -moz-box-flex-group -moz-box-flexgroup -moz-box-ordinal-group -moz-box-orient -moz-box-pack -moz-box-shadow -moz-box-sizing -moz-column-count -moz-column-gap -moz-column-rule -moz-column-rule-color -moz-column-rule-style -moz-column-rule-width -moz-column-width -moz-float-edge -moz-force-broken-image-icon -moz-image-region -moz-linear-gradient -moz-margin-end -moz-margin-start -moz-opacity -moz-outline -moz-outline-color -moz-outline-offset -moz-outline-radius -moz-outline-radius-bottomleft -moz-outline-radius-bottomright -moz-outline-radius-topleft -moz-outline-radius-topright -moz-outline-style -moz-outline-width -moz-padding-end -moz-padding-start -moz-radial-gradient -moz-stack-sizing -moz-text-decoration-color -moz-text-decoration-line -moz-text-decoration-style -moz-transform -moz-transform-origin -moz-transition -moz-transition-delay -moz-transition-duration -moz-transition-property -moz-transition-timing-function -moz-user-focus -moz-user-input -moz-user-modify -moz-user-select -moz-window-shadow -ms-filter -ms-transform -ms-transform-origin -o-transform -webkit-animation -webkit-animation-delay -webkit-animation-direction -webkit-animation-duration -webkit-animation-fill-mode -webkit-animation-iteration-count -webkit-animation-name -webkit-animation-play-state -webkit-animation-timing-function -webkit-appearance -webkit-backface-visibility -webkit-background-clip -webkit-background-composite -webkit-background-origin -webkit-background-size -webkit-border-bottom-left-radius -webkit-border-bottom-right-radius -webkit-border-horizontal-spacing -webkit-border-image -webkit-border-radius -webkit-border-top-left-radius -webkit-border-top-right-radius -webkit-border-vertical-spacing -webkit-box-align -webkit-box-direction -webkit-box-flex -webkit-box-flex-group -webkit-box-lines -webkit-box-ordinal-group -webkit-box-orient -webkit-box-pack -webkit-box-reflect -webkit-box-shadow -webkit-box-sizing -webkit-column-break-after -webkit-column-break-before -webkit-column-break-inside -webkit-column-count -webkit-column-gap -webkit-column-rule -webkit-column-rule-color -webkit-column-rule-style -webkit-column-rule-width -webkit-column-width -webkit-columns -webkit-dashboard-region -webkit-font-smoothing -webkit-gradient -webkit-line-break -webkit-linear-gradient -webkit-margin-bottom-collapse -webkit-margin-collapse -webkit-margin-start -webkit-margin-top-collapse -webkit-marquee -webkit-marquee-direction -webkit-marquee-increment -webkit-marquee-repetition -webkit-marquee-speed -webkit-marquee-style -webkit-mask -webkit-mask-attachment -webkit-mask-box-image -webkit-mask-clip -webkit-mask-composite -webkit-mask-image -webkit-mask-origin -webkit-mask-position -webkit-mask-position-x -webkit-mask-position-y -webkit-mask-repeat -webkit-mask-size -webkit-nbsp-mode -webkit-padding-start -webkit-perspective -webkit-perspective-origin -webkit-radial-gradient -webkit-rtl-ordering -webkit-tap-highlight-color -webkit-text-fill-color -webkit-text-security -webkit-text-size-adjust -webkit-text-stroke -webkit-text-stroke-color -webkit-text-stroke-width -webkit-touch-callout -webkit-transform -webkit-transform -webkit-transform-origin -webkit-transform-origin-x -webkit-transform-origin-y -webkit-transform-origin-z -webkit-transform-style -webkit-transition -webkit-transition-delay -webkit-transition-duration -webkit-transition-property -webkit-transition-timing-function -webkit-user-drag -webkit-user-modify -webkit-user-select alignment-adjust alignment-baseline animation animation-delay animation-direction animation-duration animation-iteration-count animation-name animation-play-state animation-timing-function appearance azimuth backface-visibility background background-attachment background-break background-clip background-color background-image background-origin background-position background-repeat background-size baseline-shift binding bleed bookmark-label bookmark-level bookmark-state bookmark-target border border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-align box-decoration-break box-direction box-flex box-flex-group box-lines box-ordinal-group box-orient box-pack box-shadow box-sizing break-after break-before break-inside caption-side clear clip color color-profile column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns content counter-increment counter-reset crop cue cue-after cue-before cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells filter fit fit-position float float-offset font font-effect font-emphasize font-family font-size font-size-adjust font-stretch font-style font-variant font-weight grid-columns grid-rows hanging-punctuation height hyphenate-after hyphenate-before hyphenate-character hyphenate-lines hyphenate-resource hyphens icon image-orientation image-rendering image-resolution inline-box-align left letter-spacing line-height line-stacking line-stacking-ruby line-stacking-shift line-stacking-strategy list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top mark mark-after mark-before marker-offset marks marquee-direction marquee-play-count marquee-speed marquee-style max-height max-width min-height min-width move-to nav-down nav-index nav-left nav-right nav-up opacity orphans outline outline-color outline-offset outline-style outline-width overflow overflow-style overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page page-break-after page-break-before page-break-inside page-policy pause pause-after pause-before perspective perspective-origin phonemes pitch pitch-range play-during position presentation-level punctuation-trim quotes rendering-intent resize rest rest-after rest-before richness right rotation rotation-point ruby-align ruby-overhang ruby-position ruby-span size speak speak-header speak-numeral speak-punctuation speech-rate stress string-set table-layout target target-name target-new target-position text-align text-align-last text-decoration text-emphasis text-height text-indent text-justify text-outline text-overflow text-shadow text-transform text-wrap top transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-pitch-range voice-rate voice-stress voice-volume volume white-space white-space-collapse widows width word-break word-spacing word-wrap z-index", + "active after before check checked disabled empty enabled first first-child first-letter first-line first-of-type focus hover indeterminate invalid lang last-child last-of-type left link not nth-child nth-last-child nth-of-type nth-last-of-type only-child only-of-type optional read-only read-write required right root selection target valid visited" + ] + }, + "makefile": { + "keywords": [ + + ] + }, + "shell": { + "keywords": [ + "alias ar asa awk banner basename bash bc bdiff break bunzip2 bzip2 cal calendar case cat cc cd chmod cksum clear cmp col comm compress continue cp cpio crypt csplit ctags cut date dc dd declare deroff dev df diff diff3 dircmp dirname do done du echo ed egrep elif else env esac eval ex exec exit expand export expr false fc fgrep fi file find fmt fold for function functions getconf getopt getopts grep gres hash head help history iconv id if in integer jobs join kill local lc let line ln logname look ls m4 mail mailx make man mkdir more mt mv newgrp nl nm nohup ntps od pack paste patch pathchk pax pcat perl pg pr print printf ps pwd read readonly red return rev rm rmdir sed select set sh shift size sleep sort spell split start stop strings strip stty sum suspend sync tail tar tee test then time times touch tr trap true tsort tty type typeset ulimit umask unalias uname uncompress unexpand uniq unpack unset until uudecode uuencode vi vim vpax wait wc whence which while who wpaste wstart xargs zcat" + ] + } +} diff --git a/config/scintilla.json b/config/scintilla.json deleted file mode 100644 index 712377c..0000000 --- a/config/scintilla.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "default_style": { - - }, - "languages": { - "batch": { - "keywords": [ - "rem set if else exist errorlevel for in do break call copy chcp cd chdir choice cls country ctty date del erase dir echo exit goto loadfix loadhigh mkdir md move path pause prompt rename ren rmdir rd shift time type ver verify vol com con lpt nul defined not errorlevel cmdextversion" - ] - }, - "c": { - "keywords": [ - "if else switch case default break goto return for while do continue typedef sizeof NULL", - "void struct union enum char short int long double float signed unsigned const static extern auto register volatile" - ] - }, - "cpp": { - "keywords": [ - "alignof and and_eq bitand bitor break case catch compl const_cast continue default delete do dynamic_cast else false for goto if namespace new not not_eq nullptr operator or or_eq reinterpret_cast return sizeof static_assert static_cast switch this throw true try typedef typeid using while xor xor_eq NULL", - "alignas asm auto bool char char16_t char32_t class const constexpr decltype double enum explicit export extern final float friend inline int long mutable noexcept override private protected public register short signed static struct template thread_local typename union unsigned virtual void volatile wchar_t" - ] - }, - "js": { - "keywords": [ - "abstract boolean break byte case catch char class const continue debugger default delete do double else enum export extends final finally float for function goto if implements import in instanceof int interface long native new package private protected public return short static super switch synchronized this throw throws transient try typeof var void volatile while with true false prototype" - ] - }, - "php": { - "keywords": [ - "filesize filemtime ksort sort count shell_exec disk_free_space disk_total_space file_exists strip_tags htmlentities stripslashes mysql_real_escape_string session_start error_reporting define str_replace pathinfo date time version_compare sha1 sha1_file md5 md5_file ignore_user_abort and or xor __dir__ __method__ __namespace__ __file__ __line__ array as break case cfunction class const continue declare default die do echo else elseif empty enddeclare endfor endforeach endif endswitch endwhile eval exit extends for foreach function global if include include_once isset list new old_function print require require_once return static switch unset use var while __function__ __class__ php_version php_os default_include_path pear_install_dir pear_extension_dir php_extension_dir php_bindir php_libdir php_datadir php_sysconfdir php_localstatedir php_config_file_path php_output_handler_start php_output_handler_cont php_output_handler_end e_error e_recoverable_error e_warning e_parse e_notice e_core_error e_core_warning e_compile_error e_compile_warning e_user_error e_user_warning e_user_notice e_all true false bool boolean int integer float double real string array object resource null class extends parent stdclass directory __sleep __wakeup interface implements abstract public protected private printf print_r php_major_version php_minor_version php_release_version php_version_id php_extra_version php_zts php_debug php_maxpathlen php_sapi php_eol php_int_max php_int_size php_prefix php_mandir php_config_file_scan_dir php_shlib_suffix php_windows_version_major php_windows_version_minor php_windows_version_build php_windows_version_platform php_windows_version_sp_major php_windows_version_sp_minor php_windows_version_suitemask php_windows_version_producttype php_windows_nt_domain_controller php_windows_nt_server php_windows_nt_workstation e_deprecated e_user_deprecated e_strict __compiler_halt_offset__ extr_overwrite extr_skip extr_prefix_same extr_prefix_all extr_prefix_invalid extr_prefix_if_exists extr_if_exists sort_asc sort_desc sort_regular sort_numeric sort_string case_lower case_upper count_normal count_recursive assert_active assert_callback assert_bail assert_warning assert_quiet_eval connection_aborted connection_normal connection_timeout ini_user ini_perdir ini_system ini_all m_e m_log2e m_log10e m_ln2 m_ln10 m_pi m_pi_2 m_pi_4 m_1_pi m_2_pi m_2_sqrtpi m_sqrt2 m_sqrt1_2 crypt_salt_length crypt_std_des crypt_ext_des crypt_md5 crypt_blowfish directory_separator seek_set seek_cur seek_end lock_sh lock_ex lock_un lock_nb html_specialchars html_entities ent_compat ent_quotes ent_noquotes info_general info_credits info_configuration info_modules info_environment info_variables info_license info_all credits_group credits_general credits_sapi credits_modules credits_docs credits_fullpage credits_qa credits_all str_pad_left str_pad_right str_pad_both pathinfo_dirname pathinfo_basename pathinfo_extension path_separator char_max lc_ctype lc_numeric lc_time lc_collate lc_monetary lc_all lc_messages abday_1 abday_2 abday_3 abday_4 abday_5 abday_6 abday_7 day_1 day_2 day_3 day_4 day_5 day_6 day_7 abmon_1 abmon_2 abmon_3 abmon_4 abmon_5 abmon_6 abmon_7 abmon_8 abmon_9 abmon_10 abmon_11 abmon_12 mon_1 mon_2 mon_3 mon_4 mon_5 mon_6 mon_7 mon_8 mon_9 mon_10 mon_11 mon_12 am_str pm_str d_t_fmt d_fmt t_fmt t_fmt_ampm era era_year era_d_t_fmt era_d_fmt era_t_fmt alt_digits int_curr_symbol currency_symbol crncystr mon_decimal_point mon_thousands_sep mon_grouping positive_sign negative_sign int_frac_digits frac_digits p_cs_precedes p_sep_by_space n_cs_precedes n_sep_by_space p_sign_posn n_sign_posn decimal_point radixchar thousands_sep thousep grouping yesexpr noexpr yesstr nostr codeset log_emerg log_alert log_crit log_err log_warning log_notice log_info log_debug log_kern log_user log_mail log_daemon log_auth log_syslog log_lpr log_news log_uucp log_cron log_authpriv log_local0 log_local1 log_local2 log_local3 log_local4 log_local5 log_local6 log_local7 log_pid log_cons log_odelay log_ndelay log_nowait log_perror msql_connect msql_close msql msql_create_db msql_createdb msql_drop_db msql_drop_db msql_select_db msql_select_db msql_pconnect msql msql_create_db msql_createdb msql_drop_db msql_drop_db msql_select_db msql_select_db msql_db_query msql_list_dbs msql_list_fields msql_list_tables msql_query msql msql_affected_rows msql_data_seek msql_dbname msql_fetch_array msql_fetch_field msql_fetch_object msql_fetch_row msql_field_seek msql_field_table msql_field_flags msql_field_len msql_field_name msql_field_type msql_num_fields msql_num_rows msql_numfields msql_numrows msql_result mssql_connect mssql_query mssql_select_db mssql_close mssql_pconnect mssql_query mssql_select_db mssql_query mssql_data_seek mssql_fetch_array mssql_fetch_field mssql_fetch_object mssql_fetch_row mssql_field_length mssql_field_name mssql_field_seek mssql_field_type mssql_num_fields mssql_num_rows mssql_result mssql_free_result mysql_connect mysql_affected_rows mysql_change_user mysql_create_db mysql_data_seek mysql_db_name mysql_db_query mysql_drop_db mysql_errno mysql_error mysql_insert_id mysql_list_dbs mysql_list_fields mysql_list_tables mysql_query mysql_result mysql_select_db mysql_tablename mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_close mysql_pconnect mysql_affected_rows mysql_change_user mysql_create_db mysql_data_seek mysql_db_name mysql_db_query mysql_drop_db mysql_errno mysql_error mysql_insert_id mysql_list_dbs mysql_list_fields mysql_list_tables mysql_query mysql_result mysql_select_db mysql_tablename mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_db_query mysql_list_dbs mysql_list_fields mysql_list_processes mysql_list_tables mysql_query mysql_unbuffered_query mysql_data_seek mysql_db_name mysql_fetch_array mysql_fetch_assoc mysql_fetch_field mysql_fetch_lengths mysql_fetch_object mysql_fetch_row mysql_fetch_row mysql_field_flags mysql_field_name mysql_field_len mysql_field_seek mysql_field_table mysql_field_type mysql_num_fields mysql_num_rows mysql_result mysql_tablename mysql_free_result ocilogon ociplogon ocinlogon ocicommit ociserverversion ocinewcursor ociparse ocierror ocilogoff ocinewdescriptor ocirollback ocinewdescriptor ocirowcount ocidefinebyname ocibindbyname ociexecute ocinumcols ociresult ocifetch ocifetchinto ocifetchstatement ocicolumnisnull ocicolumnname ocicolumnsize ocicolumntype ocistatementtype ocierror ocifreestatement odbc_connect odbc_autocommit odbc_commit odbc_error odbc_errormsg odbc_exec odbc_tables odbc_tableprivileges odbc_do odbc_prepare odbc_columns odbc_columnprivileges odbc_procedurecolumns odbc_specialcolumns odbc_rollback odbc_setoption odbc_gettypeinfo odbc_primarykeys odbc_foreignkeys odbc_procedures odbc_statistics odbc_close odbc_pconnect odbc_autocommit odbc_commit odbc_error odbc_errormsg odbc_exec odbc_tables odbc_tableprivileges odbc_do odbc_prepare odbc_columns odbc_columnprivileges odbc_procedurecolumns odbc_specialcolumns odbc_rollback odbc_setoption odbc_gettypeinfo odbc_primarykeys odbc_foreignkeys odbc_procedures odbc_statistics odbc_prepare odbc_binmode odbc_cursor odbc_execute odbc_fetch_into odbc_fetch_row odbc_field_name odbc_field_num odbc_field_type odbc_field_len odbc_field_precision odbc_field_scale odbc_longreadlen odbc_num_fields odbc_num_rows odbc_result odbc_result_all odbc_setoption odbc_free_result openssl_get_privatekey openssl_get_publickey openssl_sign openssl_seal openssl_open openssl_verify openssl_free_key xml_parser_create xml_parser_create_ns xml_set_object xml_set_element_handler xml_set_character_data_handler xml_set_processing_instruction_handler xml_set_default_handler xml_set_unparsed_entity_decl_handler xml_set_notation_decl_handler xml_set_external_entity_ref_handler xml_parse xml_get_error_code xml_error_string xml_get_current_line_number xml_get_current_column_number xml_get_current_byte_index xml_parse_into_struct xml_parser_set_option xml_parser_get_option xml_parser_free gzopen gzeof gzgetc gzgets gzgetss gzpassthru gzputs gzread gzrewind gzseek gztell gzwrite gzclose bzopen bzerrno bzerror bzerrstr bzflush bzread bzwrite bzclose com_load com_invoke com_propget com_get com_propput com_set com_propput imagecreate imagecreatefromgd imagecreatefromgd2 imagecreatefromgd2part imagecreatefromgif imagecreatefromjpeg imagecreatefrompng imagecreatefromwbmp imagecreatefromstring imagecreatefromxbm imagecreatefromxpm imagecreatetruecolor imagerotate imagearc imagechar imagecharup imagecolorallocate imagecolorat imagecolorclosest imagecolorexact imagecolorresolve imagegammacorrect imagegammacorrect imagecolorset imagecolorsforindex imagecolorstotal imagecolortransparent imagecopy imagecopyresized imagedashedline imagefill imagefilledpolygon imagefilledrectangle imagefilltoborder imagegif imagepng imagejpeg imagewbmp imageinterlace imageline imagepolygon imagepstext imagerectangle imagerotate imagesetpixel imagestring imagestringup imagesx imagesy imagettftext imagefilledarc imageellipse imagefilledellipse imagecolorclosestalpha imagecolorexactalpha imagecolorresolvealpha imagecopymerge imagecopymergegray imagecopyresampled imagetruecolortopalette imagesetbrush imagesettile imagesetthickness image2wbmp imagealphablending imageantialias imagecolorallocatealpha imagecolorclosesthwb imagecolordeallocate imagecolormatch imagefilter imagefttext imagegd imagegd2 imageistruecolor imagelayereffect imagepalettecopy imagesavealpha imagesetstyle imagexbm imagedestroy imageloadfont imagechar imagecharup imagefontheight imagepsloadfont imagepstext imagepsslantfont imagepsextendfont imagepsencodefont imagepsbbox imagepsfreefont curl_copy_handle curl_init curl_copy_handle curl_errno curl_error curl_exec curl_getinfo curl_setopt curl_close dba_open dba_delete dba_exists dba_fetch dba_firstkey dba_insert dba_nextkey dba_optimize dba_replace dba_sync dba_close dba_popen dba_delete dba_exists dba_fetch dba_firstkey dba_insert dba_nextkey dba_optimize dba_replace dba_sync strstr strtoupper strtolower strpos explode implode closedir getdir floatval rtrim fwrite extension_loaded final catch clone goto instanceof namespace throw try trigger_error ftp_connect ftp_ssl_connect ftp_close ftp_login ftp_pwd ftp_cdup ftp_chdir ftp_mkdir ftp_rmdir ftp_nlist ftp_rawlist ftp_systype ftp_pasv ftp_get ftp_fget ftp_put ftp_fput ftp_size ftp_mdtm ftp_rename ftp_delete ftp_site ftp_alloc ftp_chmod ftp_exec ftp_get_option ftp_nb_continue ftp_nb_fget ftp_nb_fput ftp_nb_get ftp_nb_put ftp_raw ftp_set_option imap_open imap_close imap_append imap_body imap_check imap_createmailbox imap_delete imap_deletemailbox imap_expunge imap_fetchbody imap_fetchstructure imap_headerinfo imap_header imap_headers imap_listmailbox imap_getmailboxes imap_get_quota imap_status imap_listsubscribed imap_set_quota imap_set_quota imap_getsubscribed imap_mail_copy imap_mail_move imap_num_msg imap_num_recent imap_ping imap_renamemailbox imap_reopen imap_subscribe imap_undelete imap_unsubscribe imap_scanmailbox imap_mailboxmsginfo imap_fetchheader imap_uid imap_msgno imap_search imap_fetch_overview array_change_key_case array_chunk array_combine array_count_values array_diff array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill array_fill_keys array_filter array_flip array_intersect array_intersect_assoc array_intersect_key array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map array_merge array_merge_recursive array_multisort array_pad array_pop array_product array_push array_rand array_reduce array_replace array_replace_recursive array_reverse array_search array_shift array_slice array_splice array_sum array_udiff array_udiff_assoc array_udiff_uassoc array_uintersect array_uintersect_assoc array_uintersect_uassoc array_unique array_unshift array_values array_walk array_walk_recursive arrayaccess arrayiterator arrayobject fclose flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf fseek fsockopen fstat ftell __construct __destruct" - ] - }, - "perl": { - "keywords": [ - "NULL __FILE__ __LINE__ __PACKAGE__ __DATA__ __END__ AUTOLOAD BEGIN CORE DESTROY END EQ GE GT INIT LE LT NE CHECK abs accept alarm and atan2 bind binmode bless caller chdir chmod chomp chop chown chr chroot close closedir cmp connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eq eval exec exists exit exp fcntl fileno flock for foreach fork format formline ge getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst le length link listen local localtime lock log lstat lt m map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q qq qr quotemeta qu qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir s scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn while write x xor y" - ] - }, - "python": { - "keywords": [ - "and as assert break class continue def del elif else except exec False finally for from global if import in is lambda None not or pass print raise return triple True try while with yield" - ] - }, - "css": { - "keywords": [ - "-khtml-border-radius -khtml-opacity -khtml-background-clip -khtml-background-origin -khtml-background-size -khtml-border-top-left-radius -khtml-border-top-right-radius -khtml-border-bottom-right-radius -khtml-border-bottom-left-radius -moz-animation -moz-animation-delay -moz-animation-direction -moz-animation-duration -moz-animation-fill-mode -moz-animation-iteration-count -moz-animation-name -moz-animation-play-state -moz-animation-timing-function -moz-appearance -moz-background-clip -moz-background-inline-policy -moz-background-origin -moz-background-size -moz-binding -moz-border-bottom-colors -moz-border-end -moz-border-end-color -moz-border-end-style -moz-border-end-width -moz-border-image -moz-border-left-colors -moz-border-radius -moz-border-radius-bottomleft -moz-border-radius-bottomright -moz-border-radius-topleft -moz-border-radius-topright -moz-border-right-colors -moz-border-start -moz-border-start-color -moz-border-start-style -moz-border-start-width -moz-border-top-colors -moz-box-align -moz-box-direction -moz-box-flex -moz-box-flex-group -moz-box-flexgroup -moz-box-ordinal-group -moz-box-orient -moz-box-pack -moz-box-shadow -moz-box-sizing -moz-column-count -moz-column-gap -moz-column-rule -moz-column-rule-color -moz-column-rule-style -moz-column-rule-width -moz-column-width -moz-float-edge -moz-force-broken-image-icon -moz-image-region -moz-linear-gradient -moz-margin-end -moz-margin-start -moz-opacity -moz-outline -moz-outline-color -moz-outline-offset -moz-outline-radius -moz-outline-radius-bottomleft -moz-outline-radius-bottomright -moz-outline-radius-topleft -moz-outline-radius-topright -moz-outline-style -moz-outline-width -moz-padding-end -moz-padding-start -moz-radial-gradient -moz-stack-sizing -moz-text-decoration-color -moz-text-decoration-line -moz-text-decoration-style -moz-transform -moz-transform-origin -moz-transition -moz-transition-delay -moz-transition-duration -moz-transition-property -moz-transition-timing-function -moz-user-focus -moz-user-input -moz-user-modify -moz-user-select -moz-window-shadow -ms-filter -ms-transform -ms-transform-origin -o-transform -webkit-animation -webkit-animation-delay -webkit-animation-direction -webkit-animation-duration -webkit-animation-fill-mode -webkit-animation-iteration-count -webkit-animation-name -webkit-animation-play-state -webkit-animation-timing-function -webkit-appearance -webkit-backface-visibility -webkit-background-clip -webkit-background-composite -webkit-background-origin -webkit-background-size -webkit-border-bottom-left-radius -webkit-border-bottom-right-radius -webkit-border-horizontal-spacing -webkit-border-image -webkit-border-radius -webkit-border-top-left-radius -webkit-border-top-right-radius -webkit-border-vertical-spacing -webkit-box-align -webkit-box-direction -webkit-box-flex -webkit-box-flex-group -webkit-box-lines -webkit-box-ordinal-group -webkit-box-orient -webkit-box-pack -webkit-box-reflect -webkit-box-shadow -webkit-box-sizing -webkit-column-break-after -webkit-column-break-before -webkit-column-break-inside -webkit-column-count -webkit-column-gap -webkit-column-rule -webkit-column-rule-color -webkit-column-rule-style -webkit-column-rule-width -webkit-column-width -webkit-columns -webkit-dashboard-region -webkit-font-smoothing -webkit-gradient -webkit-line-break -webkit-linear-gradient -webkit-margin-bottom-collapse -webkit-margin-collapse -webkit-margin-start -webkit-margin-top-collapse -webkit-marquee -webkit-marquee-direction -webkit-marquee-increment -webkit-marquee-repetition -webkit-marquee-speed -webkit-marquee-style -webkit-mask -webkit-mask-attachment -webkit-mask-box-image -webkit-mask-clip -webkit-mask-composite -webkit-mask-image -webkit-mask-origin -webkit-mask-position -webkit-mask-position-x -webkit-mask-position-y -webkit-mask-repeat -webkit-mask-size -webkit-nbsp-mode -webkit-padding-start -webkit-perspective -webkit-perspective-origin -webkit-radial-gradient -webkit-rtl-ordering -webkit-tap-highlight-color -webkit-text-fill-color -webkit-text-security -webkit-text-size-adjust -webkit-text-stroke -webkit-text-stroke-color -webkit-text-stroke-width -webkit-touch-callout -webkit-transform -webkit-transform -webkit-transform-origin -webkit-transform-origin-x -webkit-transform-origin-y -webkit-transform-origin-z -webkit-transform-style -webkit-transition -webkit-transition-delay -webkit-transition-duration -webkit-transition-property -webkit-transition-timing-function -webkit-user-drag -webkit-user-modify -webkit-user-select alignment-adjust alignment-baseline animation animation-delay animation-direction animation-duration animation-iteration-count animation-name animation-play-state animation-timing-function appearance azimuth backface-visibility background background-attachment background-break background-clip background-color background-image background-origin background-position background-repeat background-size baseline-shift binding bleed bookmark-label bookmark-level bookmark-state bookmark-target border border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-align box-decoration-break box-direction box-flex box-flex-group box-lines box-ordinal-group box-orient box-pack box-shadow box-sizing break-after break-before break-inside caption-side clear clip color color-profile column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns content counter-increment counter-reset crop cue cue-after cue-before cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells filter fit fit-position float float-offset font font-effect font-emphasize font-family font-size font-size-adjust font-stretch font-style font-variant font-weight grid-columns grid-rows hanging-punctuation height hyphenate-after hyphenate-before hyphenate-character hyphenate-lines hyphenate-resource hyphens icon image-orientation image-rendering image-resolution inline-box-align left letter-spacing line-height line-stacking line-stacking-ruby line-stacking-shift line-stacking-strategy list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top mark mark-after mark-before marker-offset marks marquee-direction marquee-play-count marquee-speed marquee-style max-height max-width min-height min-width move-to nav-down nav-index nav-left nav-right nav-up opacity orphans outline outline-color outline-offset outline-style outline-width overflow overflow-style overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page page-break-after page-break-before page-break-inside page-policy pause pause-after pause-before perspective perspective-origin phonemes pitch pitch-range play-during position presentation-level punctuation-trim quotes rendering-intent resize rest rest-after rest-before richness right rotation rotation-point ruby-align ruby-overhang ruby-position ruby-span size speak speak-header speak-numeral speak-punctuation speech-rate stress string-set table-layout target target-name target-new target-position text-align text-align-last text-decoration text-emphasis text-height text-indent text-justify text-outline text-overflow text-shadow text-transform text-wrap top transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-pitch-range voice-rate voice-stress voice-volume volume white-space white-space-collapse widows width word-break word-spacing word-wrap z-index", - "active after before check checked disabled empty enabled first first-child first-letter first-line first-of-type focus hover indeterminate invalid lang last-child last-of-type left link not nth-child nth-last-child nth-of-type nth-last-of-type only-child only-of-type optional read-only read-write required right root selection target valid visited" - ] - }, - "makefile": { - "keywords": [ - - ] - }, - "shell": { - "keywords": [ - "alias ar asa awk banner basename bash bc bdiff break bunzip2 bzip2 cal calendar case cat cc cd chmod cksum clear cmp col comm compress continue cp cpio crypt csplit ctags cut date dc dd declare deroff dev df diff diff3 dircmp dirname do done du echo ed egrep elif else env esac eval ex exec exit expand export expr false fc fgrep fi file find fmt fold for function functions getconf getopt getopts grep gres hash head help history iconv id if in integer jobs join kill local lc let line ln logname look ls m4 mail mailx make man mkdir more mt mv newgrp nl nm nohup ntps od pack paste patch pathchk pax pcat perl pg pr print printf ps pwd read readonly red return rev rm rmdir sed select set sh shift size sleep sort spell split start stop strings strip stty sum suspend sync tail tar tee test then time times touch tr trap true tsort tty type typeset ulimit umask unalias uname uncompress unexpand uniq unpack unset until uudecode uuencode vi vim vpax wait wc whence which while who wpaste wstart xargs zcat" - ] - } - } -} diff --git a/config/themes.json b/config/themes.json new file mode 100644 index 0000000..1c35b3c --- /dev/null +++ b/config/themes.json @@ -0,0 +1,5 @@ +{ + "solarized" : [ + + ] +} \ No newline at end of file diff --git a/src/common.h b/src/common.h index 24663b0..75cea5e 100644 --- a/src/common.h +++ b/src/common.h @@ -14,7 +14,5 @@ using namespace std; -#define JSON_INCLUDE(a, b) (string (b) = "(#include (a))") - #endif // TYRO_COMMON_H diff --git a/src/settings/Config.cpp b/src/settings/Config.cpp index ff69a31..b4126f1 100644 --- a/src/settings/Config.cpp +++ b/src/settings/Config.cpp @@ -6,12 +6,14 @@ TyroConfig::TyroConfig() { - string raw_json; - JSON_INCLUDE("../../config/scintilla.json", raw_json); + // Defines languages_json + #include "../../config/languages_json.h" + string json_string(languages_json); - cout << raw_json << endl; - - reader.parse(raw_json, default_root); + if ( ! reader.parse(json_string, default_root)) + { + cerr << reader.getFormattedErrorMessages() << endl; + } } TyroConfig::~TyroConfig() @@ -26,13 +28,5 @@ JsonValue TyroConfig::GetRoot() JsonValue TyroConfig::GetLang(string name) { - JsonValue root = this->GetRoot(); - JsonValue lang = root.get("languages", ""); - - if (lang != "") - { - return lang.get(name, ""); - } - - return JsonValue(""); + return default_root.get(name, JsonValue()); } \ No newline at end of file diff --git a/src/widgets/EditPane.cpp b/src/widgets/EditPane.cpp index 4113ee7..84852bb 100644 --- a/src/widgets/EditPane.cpp +++ b/src/widgets/EditPane.cpp @@ -35,7 +35,8 @@ bool EditPane::LoadAndHighlight(wxString filePath) this->StyleSetFaceName(i, "Anonymous Pro"); } - JsonValue keywords_array = config->GetLang("cpp"); + // Get the list of keywords for the current language + JsonValue keywords_array = config->GetLang("cpp").get("keywords", JsonValue()); this->StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColor(101, 123, 131)); this->StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColor(147, 161, 161)); @@ -71,9 +72,16 @@ bool EditPane::LoadAndHighlight(wxString filePath) this->StyleSetBold(wxSTC_C_COMMENTDOCKEYWORD, true); this->StyleSetBold(wxSTC_C_OPERATOR, true); - this->SetKeyWords(0, keywords_array[0].asString()); - this->SetKeyWords(1, keywords_array[1].asString()); - + if (keywords_array.isArray()) + { + this->SetKeyWords(0, keywords_array[0].asString()); + this->SetKeyWords(1, keywords_array[1].asString()); + } + else + { + cerr << "keywords array is not an array" << endl; + cerr << "keyword array is a " << keywords_array.type() << endl; + } return this->LoadFile(filePath); }