diff --git a/Gtk3/text_types.h b/Gtk3/text_types.h new file mode 100644 index 0000000..dbd2aac --- /dev/null +++ b/Gtk3/text_types.h @@ -0,0 +1,329 @@ +//Thanks to the gedit(gitlab.gnome.org/GNOME/gedit) +static const char *const supported_globs[] = +{ + "*.abw", + "*.adb", + "*.ads", + "*.al", + "*.asc", + "*.asp", + "*.ass", + "*.atom", + "*.automount", + "*.awk", + "*.bib", + "*.build", + "*.c", + "*.c++", + "*.cbl", + "*.cc", + "*.ccmx", + "*.cl", + "*.cls", + "*.cmake", + "*.cob", + "*.coffee", + "*.cpp", + "*.cs", + "*.csh", + "*.css", + "*.csv", + "*.csvs", + "*.cue", + "*.cxx", + "*.d", + "*.dbk", + "*.dcl", + "*.desktop", + "*.device", + "*.di", + "*.dia", + "*.diff", + "*.docbook", + "*.dot", + "*.dsl", + "*.dtd", + "*.dtx", + "*.e", + "*.eif", + "*.el", + "*.eml", + "*.ent", + "*.eps", + "*.epsf", + "*.epsi", + "*.erl", + "*.es", + "*.etx", + "*.f", + "*.f90", + "*.f95", + "*.fb2", + "*.feature", + "*.fl", + "*.flatpakref", + "*.flatpakrepo", + "*.fo", + "*.fodg", + "*.fodp", + "*.fods", + "*.fodt", + "*.for", + "*.gcode", + "*.gcrd", + "*.geojson", + "*.glade", + "*.gml", + "*.gnuplot", + "*.go", + "*.gp", + "*.gpg", + "*.gplt", + "*.gpx", + "*.gradle", + "*.groovy", + "*.gs", + "*.gsf", + "*.gsh", + "*.gv", + "*.gvp", + "*.gvy", + "*.gy", + "*.h", + "*.h++", + "*.hh", + "*.hp", + "*.hpp", + "*.hs", + "*.htm", + "*.html", + "*.hxx", + "*.ica", + "*.ics", + "*.idl", + "*.iges", + "*.igs", + "*.ime", + "*.imy", + "*.ins", + "*.iptables", + "*.ipynb", + "*.it87", + "*.jad", + "*.java", + "*.jnlp", + "*.jrd", + "*.js", + "*.jsm", + "*.json", + "*.jsonld", + "*.json-patch", + "*.kdelnk", + "*.key", + "*.kino", + "*.kml", + "*.la", + "*.latex", + "*.ldif", + "*.lhs", + "*.log", + "*.ltx", + "*.lua", + "*.ly", + "*.lyx", + "*.m", + "*.m1u", + "*.m3u", + "*.m3u8", + "*.m4", + "*.m4u", + "*.mab", + "*.mak", + "*.man", + "*.manifest", + "*.markdown", + "*.mbox", + "*.mc2", + "*.md", + "*.me", + "*.meta4", + "*.metalink", + "*.mgp", + "*.mjs", + "*.mk", + "*.mkd", + "*.ml", + "*.mli", + "*.mm", + "*.mml", + "*.mo", + "*.moc", + "*.mof", + "*.mount", + "*.mrl", + "*.mrml", + "*.ms", + "*.mup", + "*.mxu", + "*.nb", + "*.nfo", + "*.not", + "*.nzb", + "*.ocl", + "*.ooc", + "*.opml", + "*.owl", + "*.owx", + "*.p", + "*.p7s", + "*.pas", + "*.patch", + "*.path", + "*.perl", + "*.pfa", + "*.pfb", + "*.pgn", + "*.pgp", + "*.php", + "*.php3", + "*.php4", + "*.php5", + "*.phps", + "*.pkr", + "*.pl", + "*.pm", + "*.po", + "*.pod", + "*.pot", + "*.ps", + "*.py", + "*.py3", + "*.py3x", + "*.pyx", + "*.qml", + "*.qmlproject", + "*.qmltypes", + "*.qti", + "*.raml", + "*.rb", + "*.rdf", + "*.rdfs", + "*.rej", + "*.rnc", + "*.rng", + "*.roff", + "*.rs", + "*.rss", + "*.rst", + "*.rt", + "*.rtf", + "*.rtx", + "*.sami", + "*.sass", + "*.scala", + "*.scm", + "*.scope", + "*.scss", + "*.sdp", + "*.service", + "*.sgf", + "*.sgm", + "*.sgml", + "*.sh", + "*.shape", + "*.sig", + "*.siv", + "*.skr", + "*.slice", + "*.slk", + "*.smi", + "*.smil", + "*.sml", + "*.socket", + "*.spec", + "*.sql", + "*.src", + "*.srt", + "*.ss", + "*.ssa", + "*.sty", + "*.sub", + "*.sv", + "*.svg", + "*.svh", + "*.swap", + "*.sylk", + "*.t", + "*.t2t", + "*.target", + "*.tcl", + "*.tex", + "*.texi", + "*.texinfo", + "*.theme", + "*.timer", + "*.tk", + "*.toc", + "*.tr", + "*.trig", + "*.ts", + "*.tsv", + "*.ttl", + "*.ttx", + "*.twig", + "*.txt", + "*.ufraw", + "*.ui", + "*.uil", + "*.uue", + "*.v", + "*.vala", + "*.vapi", + "*.vcard", + "*.vcf", + "*.vcs", + "*.vct", + "*.vhd", + "*.vhdl", + "*.vlc", + "*.vrm", + "*.vrml", + "*.vtt", + "*.wml", + "*.wmls", + "*.wrl", + "*.wsgi", + "*.xbel", + "*.xbl", + "*.xht", + "*.xhtml", + "*.xlf", + "*.xliff", + "*.xmi", + "*.xml", + "*.xsd", + "*.xsl", + "*.xslfo", + "*.xslt", + "*.xspf", + "*.xul", + "*.yaml", + "*.yml", + "*.zabw", + NULL +}; + +static inline bool mimetype_supported(){ + /* Note that the #ifdef could be moved to where this function is called, to have + * much more code between the #ifdef/#else/#endif. The goal is to always compile + * all the code on all platforms, to catch compilation problems earlier. + */ + #ifdef G_OS_WIN32 + /* See the GtkFileChooserNative documentation, a GtkFileFilter with + * mime-types is not supported on Windows. + */ + return false; + #else + return true; + #endif +}