├── .gitignore ├── AUTHORS ├── CMakeLists.txt ├── COPYING ├── HACKING ├── Makefile.am ├── NEWS ├── README ├── TODO ├── attic ├── TODO ├── devhelp-1.dtd ├── dhb-contents-1.dtd ├── dhb-keywords-1.dtd ├── dhb-metadata-1.dtd ├── dhs-1.dtd ├── html2funcs.py ├── html2xml.py └── man2xml.py ├── cmake └── FindVala.cmake ├── contrib ├── CHM_HTB2devhelp.README ├── README ├── bulkman.pl └── texi2devhelp.sh ├── data ├── Makefile.am ├── assistant.css ├── assistant.js ├── devhelp.1 ├── icons │ ├── 16x16 │ │ └── io.github.jkozera.ZevDocs.png │ ├── 22x22 │ │ └── io.github.jkozera.ZevDocs.png │ ├── 24x24 │ │ └── io.github.jkozera.ZevDocs.png │ ├── 256x256 │ │ └── io.github.jkozera.ZevDocs.png │ ├── 32x32 │ │ └── io.github.jkozera.ZevDocs.png │ ├── 48x48 │ │ └── io.github.jkozera.ZevDocs.png │ ├── LICENSE │ ├── Makefile.am │ ├── meson.build │ └── zevdocs.svg ├── io.github.jkozera.ZevDocs.appdata.xml.in ├── io.github.jkozera.ZevDocs.desktop.in ├── io.github.jkozera.ZevDocs.desktop.snap.in ├── io.github.jkozera.ZevDocs.gschema.xml ├── io.github.jkozera.ZevDocs.gschema.xml.in ├── io.github.jkozera.ZevDocs.service.in └── meson.build ├── devhelp ├── Makefile.am ├── devhelp.h ├── dh-application-window.c ├── dh-application-window.h ├── dh-assistant-view.c ├── dh-assistant-view.h ├── dh-book-list-builder.c ├── dh-book-list-builder.h ├── dh-book-list-directory.c ├── dh-book-list-directory.h ├── dh-book-list-simple.c ├── dh-book-list-simple.h ├── dh-book-list.c ├── dh-book-list.h ├── dh-book-manager.c ├── dh-book-manager.h ├── dh-book-tree-model.c ├── dh-book-tree-model.h ├── dh-book-tree.c ├── dh-book-tree.h ├── dh-book.c ├── dh-book.h ├── dh-completion.c ├── dh-completion.h ├── dh-error.c ├── dh-error.h ├── dh-groupdialog.ui ├── dh-groupdialog.vala ├── dh-init.c ├── dh-init.h ├── dh-keyword-model.c ├── dh-keyword-model.h ├── dh-lib.gresource.xml ├── dh-link.c ├── dh-link.h ├── dh-notebook.c ├── dh-notebook.h ├── dh-parser.c ├── dh-parser.h ├── dh-profile-builder.c ├── dh-profile-builder.h ├── dh-profile-chooser.vala ├── dh-profile.c ├── dh-profile.h ├── dh-search-bar.c ├── dh-search-bar.h ├── dh-search-context.c ├── dh-search-context.h ├── dh-settings-builder.c ├── dh-settings-builder.h ├── dh-settings.c ├── dh-settings.h ├── dh-sidebar.c ├── dh-sidebar.h ├── dh-tab-label.c ├── dh-tab-label.h ├── dh-tab.c ├── dh-tab.h ├── dh-util-lib.c ├── dh-util-lib.h ├── dh-web-view.c ├── dh-web-view.h ├── future │ ├── README │ ├── dh-dconf-migration.c │ └── dh-dconf-migration.h ├── meson.build └── symbol.map ├── docs └── reference │ ├── api-breaks.xml │ ├── devhelp-docs.xml │ ├── devhelp-sections.txt │ ├── meson.build │ └── xml │ ├── gtkdocentities.ent.in │ └── meson.build ├── flatpak ├── .gitignore ├── 1-build.sh ├── 2-add-remote.sh ├── 3-install-app.sh ├── 4-run-app.sh ├── 5-teardown.sh ├── README ├── io.github.jkozera.ZevDocs.json └── org.gnome.Devhelp.json ├── help ├── C │ ├── index.page │ └── search.page ├── LINGUAS ├── cs │ └── cs.po ├── de │ └── de.po ├── es │ └── es.po ├── hr │ └── hr.po ├── hu │ └── hu.po ├── meson.build ├── pl │ └── pl.po ├── pt_BR │ └── pt_BR.po └── sv │ └── sv.po ├── meson.build ├── meson_options.txt ├── meson_post_install.py ├── plugins ├── devhelp.el ├── devhelp.vim └── gedit-plugin │ ├── devhelp.plugin.desktop.in │ ├── devhelp.py │ └── meson.build ├── po ├── LINGUAS ├── POTFILES.in ├── POTFILES.skip ├── am.po ├── ar.po ├── as.po ├── ast.po ├── az.po ├── be.po ├── be@latin.po ├── bg.po ├── bn.po ├── bn_IN.po ├── bs.po ├── ca.po ├── ca@valencia.po ├── cs.po ├── da.po ├── de.po ├── dz.po ├── el.po ├── en@shaw.po ├── en_CA.po ├── en_GB.po ├── eo.po ├── es.po ├── et.po ├── eu.po ├── fa.po ├── fi.po ├── fr.po ├── fur.po ├── gl.po ├── gu.po ├── he.po ├── hi.po ├── hr.po ├── hu.po ├── hy.po ├── id.po ├── is.po ├── it.po ├── ja.po ├── kk.po ├── km.po ├── kn.po ├── ko.po ├── lt.po ├── lv.po ├── mai.po ├── meson.build ├── mk.po ├── ml.po ├── ms.po ├── nb.po ├── ne.po ├── nl.po ├── nn.po ├── oc.po ├── or.po ├── pa.po ├── pl.po ├── ps.po ├── pt.po ├── pt_BR.po ├── ro.po ├── ru.po ├── rw.po ├── si.po ├── sk.po ├── sl.po ├── sq.po ├── sr.po ├── sr@latin.po ├── sv.po ├── ta.po ├── te.po ├── tg.po ├── th.po ├── tr.po ├── ug.po ├── uk.po ├── vi.po ├── zh_CN.po ├── zh_HK.po └── zh_TW.po ├── snap └── plugins │ ├── x-dep.py │ └── x-dep.yaml ├── snapcraft.yaml ├── src ├── Makefile.am ├── dh-app.c ├── dh-app.h ├── dh-assistant.c ├── dh-assistant.h ├── dh-assistant.ui ├── dh-main.c ├── dh-preferences.c ├── dh-preferences.h ├── dh-preferences.ui ├── dh-settings-app.c ├── dh-settings-app.h ├── dh-util-app.c ├── dh-util-app.h ├── dh-window.c ├── dh-window.h ├── dh-window.ui ├── dh.gresource.xml ├── help-overlay.ui ├── menus.ui └── meson.build ├── unit-tests ├── Makefile.am ├── meson.build ├── test-completion.c ├── test-link.c ├── test-search-context.c └── test-util.c └── zevdocs.doap /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | _build/ 3 | .idea 4 | cmake-build-debug 5 | *~ 6 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Johan Dahlin 2 | Mikael Hallendal 3 | Richard Hult 4 | Ross Burton 5 | Aleksander Morgado 6 | Frédéric Péters 7 | Sébastien Wilmet 8 | -------------------------------------------------------------------------------- /HACKING: -------------------------------------------------------------------------------- 1 | How to contribute to Devhelp 2 | ============================ 3 | 4 | Devhelp is hosted on the GNOME GitLab instance, you can fork the repository and 5 | then do a merge request: 6 | 7 | https://gitlab.gnome.org/GNOME/devhelp 8 | 9 | Read the following wiki page to know the conventions for the commit messages: 10 | 11 | https://wiki.gnome.org/Git/CommitMessages 12 | 13 | C code conventions 14 | ------------------ 15 | 16 | Devhelp follows the Linux kernel coding style, with some exceptions: 17 | - Indentation: 8 spaces, not tabs. 18 | - One space before *each* opening parenthesis. 19 | - Multi-line comments must be like this: 20 | /* First line. 21 | * Second line. 22 | */ 23 | 24 | GObject classes must not be created with a G_DECLARE macro, it causes more 25 | problems than it solves: 26 | https://blogs.gnome.org/swilmet/2015/10/10/changing-quickly-between-a-final-and-derivable-gobject-class/ 27 | 28 | g_auto macros are not used, because: 29 | 1. It makes debugging more difficult in case of a memory handling problem. 30 | 2. It breaks the uniformity of memory handling in C. Uniformity is an important 31 | principle for programming language design, as explained in the book 32 | “The Psychology of Computer Programming”: 33 | https://www.amazon.com/Psychology-Computer-Programming-Silver-Anniversary/dp/0932633420/ 34 | 3. The developer needs to be very careful when using g_auto in certain 35 | circumstances: 36 | https://blog.fishsoup.net/2015/11/05/attributecleanup-mixed-declarations-and-code-and-goto/ 37 | 38 | See also: 39 | https://developer.gnome.org/programming-guidelines/unstable/ 40 | 41 | Flatpak 42 | ------- 43 | 44 | The Devhelp maintainers maintain both the nightly and the stable versions of 45 | the Devhelp Flatpak. 46 | 47 | The nightly version is in flatpak/ and the gnome-apps-nightly module: 48 | https://gitlab.gnome.org/GNOME/gnome-apps-nightly 49 | 50 | The stable version is on Flathub: 51 | https://github.com/flathub/org.gnome.Devhelp 52 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = data plugins po help devhelp src unit-tests docs 2 | 3 | AM_DISTCHECK_CONFIGURE_FLAGS = \ 4 | --enable-gtk-doc \ 5 | --enable-introspection \ 6 | --enable-appstream-util 7 | 8 | EXTRA_DIST = zevdocs.doap 9 | 10 | MAINTAINERCLEANFILES = \ 11 | $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \ 12 | $(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \ 13 | $(GITIGNORE_MAINTAINERCLEANFILES_M4_GETTEXT) \ 14 | $(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) \ 15 | gtk-doc.make \ 16 | py-compile 17 | 18 | -include $(top_srcdir)/git.mk 19 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | ZevDocs 2 | ======= 3 | 4 | This is a fork of Devhelp with support for zealcore (https://github.com/jkozera/zealcore/) 5 | 6 | Devhelp 7 | ======= 8 | 9 | The Devhelp web page: 10 | 11 | https://wiki.gnome.org/Apps/Devhelp 12 | 13 | How to contribute 14 | ----------------- 15 | 16 | See the HACKING file. 17 | 18 | Dependencies 19 | ------------ 20 | 21 | - glib >= 2.56 22 | - gtk+ >= 3.22 23 | - webkit2gtk-4.0 >= 2.20 24 | - gsettings-desktop-schemas 25 | 26 | Description 27 | ----------- 28 | 29 | Devhelp is a developer tool for browsing and searching API documentation. 30 | It provides an easy way to navigate through libraries and to search by 31 | function, struct, or macro. 32 | 33 | The documentation must be installed locally, so an internet connection is 34 | not needed to use Devhelp. 35 | 36 | Devhelp works natively with GTK-Doc, so the GTK+ and GNOME libraries are 37 | well supported. But other development platforms can be supported as well, 38 | as long as the API documentation is available in HTML and a *.devhelp2 39 | index file is generated. 40 | 41 | Devhelp integrates with other applications such as Glade, Builder or 42 | Anjuta, and plugins are available for different text editors (gedit, Vim, 43 | Emacs, Geany, …). 44 | 45 | Integration with other developer tools 46 | -------------------------------------- 47 | 48 | Devhelp provides some command line options, such as --search and 49 | --search-assistant. A text editor plugin can for example launch the command 50 | `devhelp --search function_name` when a keyboard shortcut is pressed, with the 51 | function_name under the cursor. 52 | 53 | Devhelp also provides a shared library, to integrate the GTK+ widgets inside an 54 | IDE. It is used for example by Builder and Anjuta. 55 | 56 | For the --search command line option, see the class description of 57 | DhKeywordModel, the search string supports additional features useful for IDEs 58 | or other developer tools. 59 | 60 | How it finds the API documentation 61 | ---------------------------------- 62 | 63 | When you build (or install) a GNOME library, GTK-Doc will build an API 64 | reference for you and install it into: 65 | 66 | $datadir/gtk-doc/html/$PACKAGE/ 67 | 68 | Along with the HTML files, a *.devhelp and/or *.devhelp2 index file is 69 | also generated automatically. Thus Devhelp can simply scan that folder 70 | for those index files and display the books they represent. 71 | 72 | Devhelp uses the "XDG Base Directory Specification" to find 73 | documentation. You can read more about that specification here: 74 | 75 | https://specifications.freedesktop.org/basedir-spec/latest/ 76 | 77 | The list of locations searched for devhelp books is: 78 | 79 | $XDG_DATA_HOME/devhelp/books 80 | e.g. ~/.local/share/devhelp/books/glib/glib.devhelp2 81 | or with Flatpak: ~/.var/app/org.gnome.Devhelp/data/devhelp/books/glib/glib.devhelp2 82 | 83 | $XDG_DATA_HOME/gtk-doc/html 84 | e.g. ~/.local/share/gtk-doc/html/glib/glib.devhelp2 85 | or with Flatpak: ~/.var/app/org.gnome.Devhelp/data/gtk-doc/html/glib/glib.devhelp2 86 | 87 | $XDG_DATA_DIRS/devhelp/books 88 | e.g. /usr/share/devhelp/books/glib/glib.devhelp2 89 | 90 | $XDG_DATA_DIRS/gtk-doc/html 91 | e.g. /usr/share/gtk-doc/html/glib/glib.devhelp2 92 | 93 | Note that the two latter consist of :-separated lists of directories to 94 | look for. Those environment variables are normally set up by the 95 | desktop environment or distribution. 96 | 97 | Note that the name of the directory the *.devhelp2 file is in and the name of 98 | the *.devhelp2 file (minus the extension) must match ("glib" in the above 99 | examples). 100 | 101 | The first version of the index file format (with the *.devhelp file 102 | extension) is deprecated and its support will probably be removed in a 103 | future version. You should use the second version, with the *.devhelp2 104 | file extension. 105 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | Possible things to do in Devhelp 2 | ================================ 3 | 4 | Normally all the codebase is in a good state, except DhAssistant because I 5 | don't use it (and I think it's sometimes broken). 6 | 7 | Some stuff that can be done: 8 | 9 | Improve DhBookList API 10 | ---------------------- 11 | 12 | Make it easier to create a custom DhBookList. Maybe expose publicly 13 | DhBookListSimple and be able to subclass it. 14 | 15 | Have man-pages for the lib C 16 | ---------------------------- 17 | 18 | https://bugzilla.gnome.org/show_bug.cgi?id=616509#c6 19 | 20 | Create a software product line 21 | ------------------------------ 22 | 23 | By moving almost all the code to the libdevhelp (so the software product line 24 | is implemented by developing a library, using classic OOP design patterns). 25 | 26 | Same idea as Tepl, but applied to a smaller codebase. See: 27 | https://developer.gnome.org/tepl/unstable/intro.html 28 | https://www.amazon.com/Feature-Oriented-Software-Product-Lines-Implementation/dp/3642375200/ 29 | 30 | In Devhelp it's almost done. What remains is DhApplicationWindow, DhApplication 31 | (see how it is done in Tepl) and a toolkit to build a preferences dialog (my 32 | plan was to at least factor out a DhBookChooser widget from DhPreferences). 33 | 34 | Then with the software product line, different API browser products can be 35 | created: a generic one (same as current Devhelp), one specific for GNOME, etc. 36 | See also the roadmap on the wiki. 37 | 38 | Improve DhSettings 39 | ------------------ 40 | 41 | For the software product line, one thing that is not present in Tepl (so I 42 | needed to do the first iteration in Devhelp), is DhSettings to handle the 43 | GSettings in a library. The goal is of course to have the minimum amount of 44 | code or work to do in the applications. 45 | 46 | But I'm not entirely satisfied by the current DhSettings. But to make it better 47 | it would require lots of boilerplate code, so I was maybe thinking about a code 48 | generation tool that reads the GSettings XML schema and creates a GObject class 49 | with some properties and functions for each key. Then DhSettings would come on 50 | top of that generated class (either as a subclass or using it by composition) 51 | to add more specific functions like is_book_enabled(), set_book_enabled(), etc. 52 | 53 | The code generation tool would do something along those lines: 54 | - Add a property of type GVariant for each GSettings key. 55 | - Add getters/setters for the GVariant properties (bonus if for simple types 56 | like integers, strings, booleans, the getters/setters use the appropriate 57 | GLib type, not GVariant. Or find a way to make it convenient to use GVariant 58 | to get/set the properties). 59 | - Add bind_to_key() functions, to bind a GVariant property to its corresponding 60 | GSettings key. 61 | - For each key, add another property of type boolean to know whether the 62 | GVariant property has been bound to the GSettings key. Same name as the 63 | GVariant property, but with the -bound suffix. 64 | - Add one bind() wrapper function with an API like g_settings_bind(), but calls 65 | g_object_bind_property() if -bound property is FALSE, and calls 66 | g_settings_bind() if -bound property is TRUE, to take advantage of the 67 | writability of the GSettings key. 68 | - If more flexibility is needed, add getters to get the GSettings objects, 69 | those can be used for the keys where the -bound property is TRUE. 70 | -------------------------------------------------------------------------------- /attic/TODO: -------------------------------------------------------------------------------- 1 | TODO Devhelp attic 2 | ================== 3 | 4 | Triage the files, remove what is no longer needed, and better document what is 5 | still useful (if it's still useful it can be moved to another directory). 6 | 7 | For describing the index file format, a *.rng file would be better. The 8 | devhelp-1.dtd seems to describe the index file format version 1, which is 9 | deprecated. What are the other *.dtd files? 10 | -------------------------------------------------------------------------------- /attic/devhelp-1.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | -------------------------------------------------------------------------------- /attic/dhb-contents-1.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /attic/dhb-keywords-1.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /attic/dhb-metadata-1.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /attic/dhs-1.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | -------------------------------------------------------------------------------- /attic/html2funcs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import formatter 3 | import htmllib 4 | import sgmllib 5 | import string 6 | import sys 7 | import os.path 8 | import os 9 | 10 | SKIP_DATA = [ "Next Page", "Previous Page", "Home", "Next", "Up", "<", ">"] 11 | class HTMLParser (htmllib.HTMLParser): 12 | is_a = 0 13 | a = [] 14 | link = "" 15 | def anchor_bgn (self, href, name, type): 16 | self.is_a = 1 17 | self.link = href 18 | 19 | def anchor_end (self): 20 | self.is_a = 0 21 | 22 | def handle_data (self, data): 23 | data = string.strip (data) 24 | if data in SKIP_DATA: 25 | return 26 | 27 | if not '#' in self.link: 28 | return 29 | 30 | if self.link[:2] == "..": 31 | return 32 | 33 | if self.is_a and self.link: 34 | self.a.append ((data, self.link)) 35 | 36 | def parse_file (filename, bookname): 37 | fd = open (filename) 38 | try: 39 | p = HTMLParser (formatter.NullFormatter()) 40 | p.feed (fd.read()) 41 | p.close() 42 | except KeyboardInterrupt: 43 | raise SystemExit 44 | return p.a 45 | 46 | dirname = os.path.abspath (sys.argv[1]) 47 | bookname = os.path.basename (os.path.abspath (sys.argv[1])) 48 | files = os.listdir (dirname) 49 | files.sort() 50 | 51 | funcs = [] 52 | for file in files: 53 | if file[-5:] != ".html": 54 | continue 55 | 56 | print "parsing", file 57 | links = parse_file (dirname + "/" + file, bookname) 58 | 59 | for link in links: 60 | if not link in funcs: 61 | funcs.append (link) 62 | 63 | print "Sorting function list" 64 | funcs.sort() 65 | 66 | filename = "%s/%s.index" % (dirname, bookname) 67 | print "Writing index to", filename 68 | 69 | fd = open (filename, "w") 70 | 71 | fd.write ("\n") 72 | for name, link in funcs: 73 | if ' ' in name or '\n' in name: 74 | continue 75 | fd.write (' \n' % (name, link)) 76 | fd.write ("\n\n") 77 | 78 | fd.close() 79 | 80 | -------------------------------------------------------------------------------- /attic/html2xml.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os.path 3 | import sgmllib 4 | import string 5 | import sys 6 | 7 | def does_dict_have_keys (dict, keys): 8 | for key in keys: 9 | if not dict.has_key (key): 10 | return 0 11 | if len(dict) != len(keys): 12 | return 0 13 | return 1 14 | 15 | def walk (dict, level=0, parent=None): 16 | if dict.has_key ('order'): 17 | list = dict['order'] 18 | else: 19 | list = dict.keys() 20 | 21 | for key in list: 22 | if key in ['name', 'order', 'link']: 23 | continue 24 | if dict[key].has_key ('link') and \ 25 | does_dict_have_keys (dict[key], ['link']): 26 | link = dict[key]['link'] 27 | else: 28 | link = "" 29 | 30 | if level: 31 | print '*' * level, key, '-', link 32 | else: 33 | print key, '-', link 34 | 35 | walk (dict[key], level + 1, dict) 36 | 37 | class BookParser (sgmllib.SGMLParser): 38 | def __init__ (self): 39 | sgmllib.SGMLParser.__init__ (self) 40 | self.a = self.parents = [] 41 | self.dict = {} 42 | self.last = self.link = "" 43 | self.is_a = self.level = 0 44 | self.first = 1 45 | 46 | def unknown_starttag (self, tag, attrs): 47 | if tag == 'a': 48 | self.is_a = 1 49 | for attr in attrs: 50 | if attr[0] == "href": 51 | self.link = attr[1] 52 | break 53 | 54 | if tag in ['dd', 'ul']: 55 | self.parents.append (self.last) 56 | self.level = self.level + 1 57 | 58 | def unknown_endtag (self, tag): 59 | if tag == 'a': 60 | self.is_a = 0 61 | 62 | if tag in ['dd', 'ul']: 63 | self.level = self.level - 1 64 | self.parents.pop() 65 | 66 | def handle_data (self, data): 67 | data = string.strip (data) 68 | if not data or data in [ ">", "<" ]: 69 | return 70 | 71 | if self.first: 72 | self.dict['name'] = data 73 | self.first = 0 74 | return 75 | 76 | if data == self.dict['name'] or data in [ "Next Page", "Previous Page", "Home", "Next"]: 77 | return 78 | 79 | if len (self.parents) == 0: 80 | dict = self.dict 81 | elif len (self.parents) == 1: 82 | dict = self.dict[self.parents[0]] 83 | elif len (self.parents) == 2: 84 | dict = self.dict[self.parents[0]][self.parents[1]] 85 | elif len (self.parents) == 3: 86 | dict = self.dict[self.parents[0]][self.parents[1]][self.parents[2]] 87 | else: 88 | dict = None 89 | 90 | if self.is_a: 91 | if dict == None: 92 | return 93 | 94 | if not dict.has_key (data): 95 | dict[data] = {} 96 | if not dict.has_key ('order'): 97 | dict['order'] = [] 98 | dict['order'].append (data) 99 | dict[data]['link'] = self.link 100 | 101 | self.last = data 102 | 103 | def parse_book (url): 104 | if os.path.exists (url + "/index.html"): 105 | filename = url + "/index.html" 106 | elif os.path.exists (url + "/book1.html"): 107 | filename = url + "/book1.html" 108 | elif os.path.exists (url): 109 | filename = url 110 | else: 111 | print "Error; Can't find an index :(" 112 | raise SystemExit 113 | 114 | fd = open (filename) 115 | p = BookParser() 116 | p.feed (fd.read()) 117 | p.close() 118 | return p.dict 119 | 120 | filename = sys.argv[1] 121 | 122 | dict = parse_book (sys.argv[1]) 123 | 124 | print '' 125 | print '' % (dict['name'], os.path.basename (sys.argv[1])) 126 | 127 | print '' 128 | for chap in dict['order']: 129 | print ' ' % (chap, dict[chap]['link']) 130 | if dict[chap].has_key ('order'): 131 | for sub in dict[chap]['order']: 132 | if not does_dict_have_keys (dict[chap][sub], ['link']): 133 | print ' ' % (sub, dict[chap][sub]['link']) 134 | 135 | for sub2 in dict[chap][sub]['order']: 136 | print ' ' % (sub2, dict[chap][sub][sub2]['link']) 137 | print ' ' 138 | else: 139 | print ' ' % (sub, dict[chap][sub]['link']) 140 | 141 | print ' ' 142 | print 143 | 144 | print '' 145 | print 146 | print '' 147 | 148 | -------------------------------------------------------------------------------- /attic/man2xml.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import os.path 4 | import string 5 | 6 | # Generates a *.devhelp index file (old format) for man pages. 7 | # Just the index file, this script doesn't generate HTML pages for each man 8 | # page. 9 | 10 | # Add $GNOME_PATH/man too 11 | #MAN_PATH = ["/usr/man", "/usr/share/man", "/usr/local/man"] 12 | MAN_PATH = ["/usr/share/man"] 13 | MAN_SUBS = ["man1", "man2", "man3", "man4", "man5", 14 | "man6", "man7", "man8", "man9"] 15 | 16 | MAN_NAME = { "man1" : "Applications", 17 | "man2" : "System Calls", 18 | "man3" : "Library Functions", 19 | "man4" : "Devices", 20 | "man5" : "Configuration Files", 21 | "man6" : "Games", 22 | "man7" : "Conventions", 23 | "man8" : "System Administration", 24 | "man9" : "Kernel Routines"} 25 | 26 | # 1. Get a list of all mandirs 27 | chapters = [] 28 | for mandir in MAN_PATH: 29 | dir_list = os.listdir (mandir) 30 | for dir in dir_list: 31 | if os.path.isdir (mandir + "/" + dir) and dir in MAN_SUBS: 32 | chapters.append (mandir + "/" + dir) 33 | 34 | # 2. Get a list of all manpages 35 | man_pages = {} 36 | funcs = [] 37 | for mandir in chapters: 38 | list = os.listdir (mandir) 39 | for file in list: 40 | # Extract the name of the man page 41 | name, section = string.split (file, ".", 1) 42 | if section[-3:] == ".gz": 43 | section = section[:-3] 44 | 45 | man = os.path.basename (mandir) 46 | filename = mandir + "/" + file 47 | 48 | # Check out section 2* and 3*, but not 3pm 49 | if section in ['2', '3'] and section[-2:] != "pm": 50 | # Remove perl funtions 51 | if string.find (name, "::") == -1: 52 | funcs.append ((name, filename)) 53 | 54 | # Does the the dict have the key? 55 | if not man_pages.has_key (man): 56 | man_pages[man] = [] 57 | 58 | if name == "." or not name: 59 | continue 60 | 61 | man_pages[man].append ((name, filename)) 62 | 63 | # 3. Print out xml 64 | print '' 65 | print '' 66 | print 67 | 68 | # 3.1 Print chapters 69 | # Chapters 70 | chapters.sort() 71 | written = [] 72 | print '' 73 | for chap in chapters: 74 | name = os.path.basename (chap) 75 | if not man_pages.has_key (name): 76 | continue 77 | 78 | if name in written: 79 | continue 80 | written.append (name) 81 | 82 | print ' ' % MAN_NAME[name] 83 | list = man_pages[name] 84 | list.sort() 85 | 86 | for name, page in list: 87 | print ' ' % (name, page) 88 | print ' ' 89 | print 90 | 91 | print '' 92 | print 93 | 94 | # 3.2 print functions 95 | # Functions 96 | funcs.sort() 97 | print '' 98 | for name, file in funcs: 99 | print ' ' % (name, file) 100 | print '' 101 | print 102 | print '' 103 | 104 | 105 | -------------------------------------------------------------------------------- /contrib/CHM_HTB2devhelp.README: -------------------------------------------------------------------------------- 1 | I wanted to inform DevHelp developers and users that it's now possible 2 | to convert full books in CHM and HTB into DevHelp book format, by using 3 | a generic HTML Help book framework I wrote in Python: 4 | 5 | http://htmlhelp.berlios.de/api/python/ 6 | 7 | Basically, to convert a CHM book into a DevHelp is as simple as: 8 | 9 | hhconvert /path/to/book.chm /path/to/book.tgz 10 | 11 | The code is only available in the subversion repository - there is no 12 | tarball as the code is not yet ready for prime time. 13 | 14 | That said I also want to inform that I'll stop providing more books in 15 | DevHelp format, i.e., I'll no longer update those in 16 | http://htmlhelp.berlios.de/books/devhelp.php . There is no intention in 17 | making DevHelp a full-fledge viewer. It has very limited functionality 18 | compared e.g., with PHP+MySQL web interface as in 19 | http://htmlhelp.berlios.de/web/php.php and something similar can be done 20 | much more easily with Python as in http://gnochm.sourceforge.net . I 21 | still would like to have a nice documentation browser in gnome, but I 22 | think DevHelp is no longer the way to achieve it. 23 | 24 | If anybody still wants DevHelp books they can make it themselves using 25 | the above process. 26 | 27 | In the near future I'll implement the opposite, i.e., allow convertion of 28 | DevHelp books into CHM/HTB, to use with the GTK/GNOME documentation. 29 | 30 | I hope you find this useful/interesting. 31 | 32 | José Fonseca 33 | 34 | Mail originally at: 35 | http://lists.gnome.org/archives/gnome-devtools/2004-January/msg00056.html 36 | 37 | -------------------------------------------------------------------------------- /contrib/README: -------------------------------------------------------------------------------- 1 | These scripts are not maintained by the Devhelp maintainer and suggestions and 2 | comments should be sent directly to the script author. 3 | -------------------------------------------------------------------------------- /contrib/texi2devhelp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This scripts generates a devhelp meta file using the TOC and .idx files 3 | # generated by texi2html 4 | # 5 | # written by Tobias Gruetzmacher 6 | # 7 | # Example usage: 8 | # texi2html -Verbose -split=section -idx_sum -subdir=doc/devhelp/autoconf-2.59 doc/autoconf.texi 9 | # gen-meta-devhelp.sh doc/devhelp/autoconf-2.59 autoconf Autoconf 2.59 10 | # rm doc/devhelp/autoconf-2.59/*.idx 11 | 12 | if [ "$#" -ne 4 ] 13 | then 14 | echo "Syntax: `basename $0` " 15 | exit 1 16 | fi 17 | 18 | dir=$1 19 | name=$2 20 | title=$3 21 | ver=$4 22 | 23 | exec > $dir/$name-$ver.devhelp 24 | 25 | cat < 27 | 28 | 29 | 30 | 31 | EOF 32 | 33 | sed -n '1, /^

/ d 34 | /^
$/ N 36 | s/^
\n
$// 37 | s/^
/<\/sub>/ 38 | s/<\/\?\(TT\|CODE\|FONT\)[^>]*>//ig 39 | s/\(.*\)<\/A>//p 40 | s/<\/BLOCKQUOTE>$/<\/sub>/p' $dir/${name}_toc.html | sed '$d' 41 | 42 | cat < 44 | 45 | 46 | EOF 47 | 48 | sed 's/&/\&/g; s/"/\"/g; s//\>/g 49 | s/^//' $dir/*.idx 52 | 53 | cat < 55 | 56 | 57 | EOF 58 | 59 | -------------------------------------------------------------------------------- /data/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = icons 2 | 3 | pkgconfigdir = $(libdir)/pkgconfig 4 | pkgconfig_DATA = libdevhelp-3.0.pc 5 | 6 | assistantdir = $(datadir)/devhelp/assistant 7 | assistant_DATA = \ 8 | assistant.js \ 9 | assistant.css 10 | 11 | gsettings_SCHEMAS = \ 12 | org.gnome.devhelp.gschema.xml \ 13 | org.gnome.libdevhelp-3.gschema.xml 14 | @GSETTINGS_RULES@ 15 | 16 | appstream_in_files = io.github.jkozera.ZevDocs.appdata.xml.in 17 | appstream_XML = $(appstream_in_files:.xml.in=.xml) 18 | @APPSTREAM_XML_RULES@ 19 | 20 | $(appstream_XML): $(appstream_in_files) 21 | $(AM_V_GEN) $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@ 22 | 23 | desktopdir = $(datadir)/applications 24 | desktop_in_file = io.github.jkozera.ZevDocs.desktop.in 25 | desktop_DATA = io.github.jkozera.ZevDocs.desktop 26 | 27 | $(desktop_DATA): $(desktop_in_file) 28 | $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ 29 | 30 | dbusservicedir = $(datadir)/dbus-1/services 31 | dbusservice_DATA = io.github.jkozera.ZevDocs.service 32 | 33 | io.github.jkozera.ZevDocs.service: Makefile 34 | $(AM_V_GEN) (echo '[D-BUS Service]'; \ 35 | echo 'Name=io.github.jkozera.ZevDocs'; \ 36 | echo 'Exec=${bindir}/zevdocs --gapplication-service') > $@.tmp && \ 37 | mv $@.tmp $@ 38 | 39 | man_MANS = devhelp.1 40 | 41 | EXTRA_DIST = \ 42 | libdevhelp-3.0.pc.in \ 43 | $(desktop_in_file) \ 44 | $(gsettings_SCHEMAS) \ 45 | $(assistant_DATA) \ 46 | $(man_MANS) \ 47 | $(appstream_in_files) 48 | 49 | CLEANFILES = \ 50 | $(defaults_DATA) \ 51 | $(desktop_DATA) \ 52 | $(dbusservice_DATA) \ 53 | $(appstream_XML) 54 | 55 | -include $(top_srcdir)/git.mk 56 | -------------------------------------------------------------------------------- /data/assistant.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | body * { 7 | font-size: 9pt; 8 | } 9 | 10 | a { 11 | text-decoration: none; 12 | } 13 | 14 | .title { 15 | font-size: 11pt; 16 | margin: 6pt; 17 | 18 | color: #a52a2a; 19 | } 20 | .title a { 21 | font-size: 11pt; 22 | 23 | color: #a52a2a; 24 | } 25 | .subtitle { 26 | font-size: 9pt; 27 | margin: 6pt; 28 | 29 | color: #a52a2a; 30 | } 31 | 32 | .content { 33 | margin: 6pt; 34 | line-height: 1.3em; 35 | } 36 | 37 | div.book { 38 | display: none; 39 | position: absolute; 40 | right: 6pt; 41 | top: 6pt; 42 | color: #a52a2a; 43 | } 44 | 45 | div.warning { 46 | color: #A52A2A; 47 | margin: 0 !important; 48 | } 49 | div.warning h3 { 50 | background: inherit; 51 | padding: 0; 52 | margin: 0; 53 | font-size: inherit; 54 | } 55 | 56 | div.note { 57 | margin: 0 !important; 58 | } 59 | div.note h3 { 60 | padding: 0; 61 | margin: 0; 62 | font-size: inherit; 63 | } 64 | 65 | p { 66 | margin-top: 0; 67 | margin-left: 2pt; 68 | } 69 | 70 | div.variablelist { 71 | padding: 6pt; 72 | background: #dddddd; 73 | -webkit-border-radius: 5px; 74 | } 75 | 76 | code { 77 | font-family: "Bitstream Vera Sans Mono", Monaco, Courier, monospace; 78 | font-size: 8pt; 79 | } 80 | 81 | pre.programlisting { 82 | font-family: "Bitstream Vera Sans Mono", Monaco, Courier, monospace; 83 | font-size: 8pt; 84 | padding: 6pt; 85 | background: #dddddd; 86 | -webkit-border-radius: 5px; 87 | overflow: hidden; 88 | } 89 | 90 | pre.programlisting a { 91 | font-family: "Bitstream Vera Sans Mono", Monaco, Courier, monospace; 92 | font-size: 8pt; 93 | } 94 | 95 | div.variablelist { 96 | margin-bottom: 6pt; 97 | } 98 | 99 | div.variablelist * { 100 | vertical-align: top; 101 | line-height: 1.3em; 102 | } 103 | 104 | hr { 105 | display: none; 106 | } 107 | -------------------------------------------------------------------------------- /data/devhelp.1: -------------------------------------------------------------------------------- 1 | .TH "devhelp" "1" "" "" "devhelp" 2 | .SH "NAME" 3 | .LP 4 | devhelp \- An API documentation browser 5 | .SH "SYNTAX" 6 | .LP 7 | devhelp [\fIOPTIONS\fP] 8 | .SH "DESCRIPTION" 9 | .LP 10 | Devhelp is an API documentation browser for GNOME. 11 | .br 12 | .SH "OPTIONS" 13 | .LP 14 | .TP 15 | \fB\-s, \-\-search\fR=KEYWORD 16 | Search for a keyword (function, symbol...). 17 | .LP 18 | .TP 19 | \fB\-a, \-\-search-assistant\fR=KEYWORD 20 | Search and display any hit in the assistant window. 21 | .SH "EXAMPLES" 22 | .LP 23 | To run this program the standard way type: 24 | .LP 25 | devhelp 26 | .LP 27 | If you would like to search for a function, type: 28 | .LP 29 | devhelp \-s search-string 30 | .SH "AUTHORS" 31 | .LP 32 | Devhelp was written by Johan Dahlin , Mikael Hallendal 33 | , Richard Hult , Frederic Peters 34 | , Aleksander Morgado , and 35 | Ignacio Casal Quinteiro . 36 | .LP 37 | This manual page is Copyright (c) 2001 Johan Dahlin and Copyright(c) 2015 Frederic Peters . 38 | It has been written for the Debian GNU/Linux distribution and is distributed under the GNU General Public License. As such, it may be used, modified and distributed by anyone else as long as this copyright notice is preserved. 39 | -------------------------------------------------------------------------------- /data/icons/16x16/io.github.jkozera.ZevDocs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmymay/zevdocs/453629be8c90a4e5f76694415752ba8d4a829124/data/icons/16x16/io.github.jkozera.ZevDocs.png -------------------------------------------------------------------------------- /data/icons/22x22/io.github.jkozera.ZevDocs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmymay/zevdocs/453629be8c90a4e5f76694415752ba8d4a829124/data/icons/22x22/io.github.jkozera.ZevDocs.png -------------------------------------------------------------------------------- /data/icons/24x24/io.github.jkozera.ZevDocs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmymay/zevdocs/453629be8c90a4e5f76694415752ba8d4a829124/data/icons/24x24/io.github.jkozera.ZevDocs.png -------------------------------------------------------------------------------- /data/icons/256x256/io.github.jkozera.ZevDocs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmymay/zevdocs/453629be8c90a4e5f76694415752ba8d4a829124/data/icons/256x256/io.github.jkozera.ZevDocs.png -------------------------------------------------------------------------------- /data/icons/32x32/io.github.jkozera.ZevDocs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmymay/zevdocs/453629be8c90a4e5f76694415752ba8d4a829124/data/icons/32x32/io.github.jkozera.ZevDocs.png -------------------------------------------------------------------------------- /data/icons/48x48/io.github.jkozera.ZevDocs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmymay/zevdocs/453629be8c90a4e5f76694415752ba8d4a829124/data/icons/48x48/io.github.jkozera.ZevDocs.png -------------------------------------------------------------------------------- /data/icons/LICENSE: -------------------------------------------------------------------------------- 1 | zevdocs.svg: 2 | 3 | The MIT License 4 | 5 | Copyright (c) 2015 VisualPharm LLC. http://icons8.com 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | 13 | 14 | (taken from https://github.com/icons8/flat-color-icons/blob/master/svg/biomass.svg 15 | "#Good Boy License 16 | We’ve released the icon pack under either MIT or the [Good Boy License](https://icons8.com/good-boy-license/). We invented it. Please do _whatever your mom would approve of:_ 17 | 18 | ##Permitted Use 19 | 20 | * Download in any format 21 | * Change 22 | * Fork 23 | 24 | ##Prohibited Use 25 | 26 | * No tattoos 27 | * No touching with unwashed hands 28 | * No exchanging for drugs. 29 | ") 30 | -------------------------------------------------------------------------------- /data/icons/Makefile.am: -------------------------------------------------------------------------------- 1 | icon16dir = $(datadir)/icons/hicolor/16x16/apps 2 | icon16_DATA = 16x16/zevdocs.png 3 | 4 | icon22dir = $(datadir)/icons/hicolor/22x22/apps 5 | icon22_DATA = 22x22/zevdocs.png 6 | 7 | icon24dir = $(datadir)/icons/hicolor/24x24/apps 8 | icon24_DATA = 24x24/zevdocs.png 9 | 10 | icon32dir = $(datadir)/icons/hicolor/32x32/apps 11 | icon32_DATA = 32x32/zevdocs.png 12 | 13 | icon48dir = $(datadir)/icons/hicolor/48x48/apps 14 | icon48_DATA = 48x48/zevdocs.png 15 | 16 | icon256dir = $(datadir)/icons/hicolor/256x256/apps 17 | icon256_DATA = 256x256/zevdocs.png 18 | 19 | gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor 20 | 21 | install-data-hook: update-icon-cache 22 | uninstall-hook: update-icon-cache 23 | update-icon-cache: 24 | @-if test -z "$(DESTDIR)"; then \ 25 | echo "Updating Gtk icon cache."; \ 26 | $(gtk_update_icon_cache); \ 27 | else \ 28 | echo "*** Icon cache not updated. After (un)install, run this:"; \ 29 | echo "*** $(gtk_update_icon_cache)"; \ 30 | fi 31 | 32 | EXTRA_DIST = \ 33 | $(icon16_DATA) \ 34 | $(icon22_DATA) \ 35 | $(icon24_DATA) \ 36 | $(icon32_DATA) \ 37 | $(icon48_DATA) \ 38 | $(icon256_DATA) \ 39 | zevdocs.svg 40 | 41 | -include $(top_srcdir)/git.mk 42 | -------------------------------------------------------------------------------- /data/icons/meson.build: -------------------------------------------------------------------------------- 1 | icon_sizes = [ 2 | '16x16', 3 | '22x22', 4 | '24x24', 5 | '32x32', 6 | '48x48', 7 | '256x256' 8 | ] 9 | 10 | foreach icon_size : icon_sizes 11 | install_data( 12 | join_paths(icon_size, 'io.github.jkozera.ZevDocs.png'), 13 | install_dir : join_paths( 14 | get_option('prefix'), 15 | get_option('datadir'), 16 | 'icons/hicolor', 17 | icon_size, 18 | 'apps' 19 | ) 20 | ) 21 | endforeach -------------------------------------------------------------------------------- /data/io.github.jkozera.ZevDocs.appdata.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | io.github.jkozera.ZevDocs.desktop 4 | CC0-1.0 5 | GPL-3.0 6 | ZevDocs 7 | A developer tool for browsing and searching API documentation 8 | 9 |

10 | ZevDocs is a fork of Devhelp with support for Dash docsets. 11 |

12 |

13 | Now with dark mode support! 14 |

15 |
16 | https://jkozera.github.io/zevdocs/ 17 | https://github.com/jkozera/zevdocs/issues/ 18 | http://www.gnome.org/friends/ 19 | 20 | 21 | https://jkozera.github.io/zevdocs/screenshot.png 22 | 23 | 24 | https://jkozera.github.io/zevdocs/screenshot2.png 25 | 26 | 27 | https://jkozera.github.io/zevdocs/screenshot3.png 28 | 29 | 30 | GNOME 31 | devhelp 32 | jerzy.kozera@gmail.com 33 | 34 | none 35 | none 36 | none 37 | none 38 | none 39 | none 40 | none 41 | none 42 | none 43 | none 44 | none 45 | none 46 | none 47 | none 48 | none 49 | none 50 | none 51 | none 52 | none 53 | none 54 | none 55 | none 56 | none 57 | none 58 | none 59 | none 60 | none 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
76 | -------------------------------------------------------------------------------- /data/io.github.jkozera.ZevDocs.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=ZevDocs 3 | Comment=A developer tool for browsing and searching API documentation 4 | GenericName=API Documentation Browser 5 | # Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! 6 | Keywords=documentation;information;manual;developer;api; 7 | Exec=zevdocs 8 | Terminal=false 9 | Type=Application 10 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 11 | Icon=io.github.jkozera.ZevDocs 12 | Categories=GNOME;GTK;Development; 13 | StartupNotify=true 14 | DBusActivatable=true 15 | -------------------------------------------------------------------------------- /data/io.github.jkozera.ZevDocs.desktop.snap.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=ZevDocs 3 | Comment=A developer tool for browsing and searching API documentation 4 | GenericName=API Documentation Browser 5 | # Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! 6 | Keywords=documentation;information;manual;developer;api; 7 | Exec=zevdocs 8 | Terminal=false 9 | Type=Application 10 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 11 | Icon=io.github.jkozera.ZevDocs 12 | Categories=GNOME;GTK;Development; 13 | StartupNotify=true 14 | -------------------------------------------------------------------------------- /data/io.github.jkozera.ZevDocs.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | false 16 | Main window maximized state 17 | Whether the main window should start maximized. 18 | 19 | 20 | 1000 21 | Width of the main window 22 | The width of the main window. 23 | 24 | 25 | 500 26 | Height of main window 27 | The height of the main window. 28 | 29 | 30 | 31 | 32 | 300 33 | Width of the index and search pane 34 | The width of the index and search pane. 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 350 43 | Width of the assistant window 44 | The width of the assistant window. 45 | 46 | 47 | 400 48 | Height of assistant window 49 | The height of the assistant window. 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /data/io.github.jkozera.ZevDocs.gschema.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | [] 9 | Books disabled 10 | List of books disabled by the user. 11 | 12 | 13 | false 14 | Group books by language 15 | Whether books should be grouped by programming language in the user interface. 16 | 17 | 18 | 19 | 20 | true 21 | Use system fonts 22 | Use the system default fonts. 23 | 24 | 25 | 'Sans 12' 26 | Font for text 27 | Font for text with variable width. 28 | 29 | 30 | 'Monospace 12' 31 | Font for fixed width text 32 | Font for text with fixed width, such as code examples. 33 | 34 | 35 | false 36 | Use dark mode 37 | Use dark mode. 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /data/io.github.jkozera.ZevDocs.service.in: -------------------------------------------------------------------------------- 1 | [D-BUS Service] 2 | Name=io.github.jkozera.ZevDocs 3 | Exec=@bindir@/zevdocs --gapplication-service 4 | -------------------------------------------------------------------------------- /data/meson.build: -------------------------------------------------------------------------------- 1 | subdir('icons') 2 | 3 | install_data( 4 | 'io.github.jkozera.ZevDocs.gschema.xml', 5 | install_dir : join_paths(get_option('prefix'), get_option('datadir'), 'glib-2.0/schemas') 6 | ) 7 | 8 | libdevhelp_gschema_conf = configuration_data() 9 | libdevhelp_gschema_conf.set('LIBDEVHELP_API_VERSION', LIBDEVHELP_API_VERSION) 10 | configure_file( 11 | input : 'io.github.jkozera.ZevDocs.gschema.xml.in', 12 | output : 'io.github.jkozera.ZevDocs-@0@.gschema.xml'.format(LIBDEVHELP_API_VERSION), 13 | configuration : libdevhelp_gschema_conf, 14 | install : true, 15 | install_dir : join_paths(get_option('prefix'), get_option('datadir'), 'glib-2.0/schemas') 16 | ) 17 | 18 | appdata = 'io.github.jkozera.ZevDocs.appdata.xml' 19 | I18N.merge_file( 20 | appdata, 21 | input : appdata + '.in', 22 | output : appdata, 23 | po_dir : '../po/', 24 | install : true, 25 | install_dir : join_paths(get_option('prefix'), get_option('datadir'), 'metainfo') 26 | ) 27 | 28 | 29 | desktop_file = 'io.github.jkozera.ZevDocs.desktop' 30 | if get_option('snap_build') 31 | I18N.merge_file( 32 | desktop_file, 33 | type : 'desktop', 34 | input : desktop_file + '.snap.in', 35 | output : desktop_file, 36 | po_dir : '../po/', 37 | install : true, 38 | install_dir : join_paths(get_option('prefix'), get_option('datadir'), 'applications') 39 | ) 40 | else 41 | I18N.merge_file( 42 | desktop_file, 43 | type : 'desktop', 44 | input : desktop_file + '.in', 45 | output : desktop_file, 46 | po_dir : '../po/', 47 | install : true, 48 | install_dir : join_paths(get_option('prefix'), get_option('datadir'), 'applications') 49 | ) 50 | 51 | service_file = 'io.github.jkozera.ZevDocs.service' 52 | service_conf = configuration_data() 53 | service_conf.set('bindir', join_paths(get_option('prefix'), get_option('bindir'))) 54 | configure_file( 55 | input : service_file + '.in', 56 | output : service_file, 57 | configuration : service_conf, 58 | install : true, 59 | install_dir : join_paths(get_option('prefix'), get_option('datadir'), 'dbus-1/services') 60 | ) 61 | endif 62 | 63 | install_data( 64 | ['assistant.css', 'assistant.js'], 65 | install_dir : join_paths(get_option('prefix'), get_option('datadir'), 'devhelp/assistant') 66 | ) 67 | 68 | install_data( 69 | 'devhelp.1', 70 | install_dir : join_paths(get_option('prefix'), get_option('mandir'), 'man1') 71 | ) 72 | -------------------------------------------------------------------------------- /devhelp/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -I$(top_srcdir) \ 3 | -DLOCALEDIR=\""$(localedir)"\" \ 4 | -DDATADIR=\""$(datadir)"\" \ 5 | -DG_LOG_DOMAIN=\"Devhelp\" \ 6 | $(WARN_CFLAGS) 7 | 8 | AM_LDFLAGS = \ 9 | $(WARN_LDFLAGS) 10 | 11 | libdevhelp_public_headers = \ 12 | devhelp.h \ 13 | dh-assistant-view.h \ 14 | dh-book.h \ 15 | dh-book-manager.h \ 16 | dh-book-tree.h \ 17 | dh-book-tree-model.h \ 18 | dh-completion.h \ 19 | dh-init.h \ 20 | dh-keyword-model.h \ 21 | dh-link.h \ 22 | dh-sidebar.h \ 23 | $(NULL) 24 | 25 | libdevhelp_public_c_files = \ 26 | dh-assistant-view.c \ 27 | dh-book.c \ 28 | dh-book-manager.c \ 29 | dh-book-tree.c \ 30 | dh-book-tree-model.c \ 31 | dh-completion.c \ 32 | dh-init.c \ 33 | dh-keyword-model.c \ 34 | dh-link.c \ 35 | dh-sidebar.c \ 36 | $(NULL) 37 | 38 | libdevhelp_private_headers = \ 39 | dh-error.h \ 40 | dh-parser.h \ 41 | dh-search-context.h \ 42 | dh-settings.h \ 43 | dh-util-lib.h \ 44 | $(NULL) 45 | 46 | libdevhelp_private_c_files = \ 47 | dh-error.c \ 48 | dh-parser.c \ 49 | dh-search-context.c \ 50 | dh-settings.c \ 51 | dh-util-lib.c \ 52 | $(NULL) 53 | 54 | libdevhelp_built_public_headers = \ 55 | dh-enum-types.h \ 56 | $(NULL) 57 | 58 | libdevhelp_built_public_c_files = \ 59 | dh-enum-types.c \ 60 | $(NULL) 61 | 62 | libdevhelp_built_sources = \ 63 | $(libdevhelp_built_public_headers) \ 64 | $(libdevhelp_built_public_c_files) \ 65 | $(NULL) 66 | 67 | BUILT_SOURCES = \ 68 | $(libdevhelp_built_sources) \ 69 | $(NULL) 70 | 71 | # Helper Libtool library, so that the private functions can be used in unit 72 | # tests. 73 | noinst_LTLIBRARIES = libdevhelp-core.la 74 | 75 | libdevhelp_core_la_SOURCES = \ 76 | $(libdevhelp_public_headers) \ 77 | $(libdevhelp_public_c_files) \ 78 | $(libdevhelp_private_headers) \ 79 | $(libdevhelp_private_c_files) 80 | 81 | # Do not distribute generated files. 82 | nodist_libdevhelp_core_la_SOURCES = \ 83 | $(libdevhelp_built_sources) 84 | 85 | libdevhelp_core_la_CPPFLAGS = \ 86 | $(AM_CPPFLAGS) 87 | 88 | libdevhelp_core_la_CFLAGS = \ 89 | $(ZEVDOCS_CFLAGS) 90 | 91 | libdevhelp_core_la_LDFLAGS = \ 92 | $(AM_LDFLAGS) \ 93 | -no-undefined 94 | 95 | # The library 96 | lib_LTLIBRARIES = libdevhelp-3.la 97 | 98 | devhelpincludedir = $(includedir)/devhelp-3.0/devhelp 99 | devhelpinclude_HEADERS = $(libdevhelp_public_headers) 100 | nodist_devhelpinclude_HEADERS = $(libdevhelp_built_public_headers) 101 | 102 | libdevhelp_3_la_SOURCES = 103 | 104 | libdevhelp_3_la_LIBADD = \ 105 | libdevhelp-core.la \ 106 | $(ZEVDOCS_LIBS) 107 | 108 | libdevhelp_3_la_LDFLAGS = \ 109 | $(AM_LDFLAGS) \ 110 | -no-undefined \ 111 | -version-info $(LIBDEVHELP_LT_VERSION) \ 112 | -export-symbols-regex ^dh_ 113 | 114 | dh-enum-types.h: dh-enum-types.h.template $(libdevhelp_public_headers) $(GLIB_MKENUMS) 115 | $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template dh-enum-types.h.template $(libdevhelp_public_headers)) > $@ 116 | 117 | dh-enum-types.c: dh-enum-types.c.template $(libdevhelp_public_headers) $(GLIB_MKENUMS) 118 | $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template dh-enum-types.c.template $(libdevhelp_public_headers)) > $@ 119 | 120 | EXTRA_DIST = \ 121 | dh-enum-types.c.template \ 122 | dh-enum-types.h.template \ 123 | $(NULL) 124 | 125 | CLEANFILES = $(BUILT_SOURCES) 126 | 127 | if HAVE_INTROSPECTION 128 | -include $(INTROSPECTION_MAKEFILE) 129 | INTROSPECTION_GIRS = Devhelp-3.0.gir 130 | 131 | INTROSPECTION_SCANNER_ENV = CC="$(CC)" 132 | 133 | Devhelp-3.0.gir: libdevhelp-3.la $(BUILT_SOURCES) 134 | INTROSPECTION_SCANNER_ARGS = \ 135 | -I$(top_srcdir) \ 136 | -I$(top_builddir) \ 137 | --identifier-prefix Dh \ 138 | --identifier-prefix dh \ 139 | --c-include=devhelp/devhelp.h \ 140 | --warn-all 141 | Devhelp_3_0_gir_CFLAGS = $(ZEVDOCS_CFLAGS) 142 | Devhelp_3_0_gir_SCANNERFLAGS = $(WARN_SCANNERFLAGS) 143 | Devhelp_3_0_gir_LIBS = libdevhelp-3.la 144 | Devhelp_3_0_gir_FILES = \ 145 | $(libdevhelp_public_headers) \ 146 | $(libdevhelp_public_c_files) \ 147 | $(libdevhelp_built_public_headers) \ 148 | $(libdevhelp_built_public_c_files) 149 | 150 | Devhelp_3_0_gir_INCLUDES = Gtk-3.0 WebKit2-4.0 151 | Devhelp_3_0_gir_PACKAGES = gtk+-3.0 webkit2gtk-4.0 152 | Devhelp_3_0_gir_EXPORT_PACKAGES = libdevhelp-3.0 153 | 154 | girdir = $(datadir)/gir-1.0 155 | gir_DATA = Devhelp-3.0.gir 156 | 157 | typelibdir = $(libdir)/girepository-1.0 158 | typelib_DATA = Devhelp-3.0.typelib 159 | 160 | CLEANFILES += \ 161 | $(gir_DATA) \ 162 | $(typelib_DATA) 163 | 164 | endif # HAVE_INTROSPECTION 165 | 166 | -include $(top_srcdir)/git.mk 167 | -------------------------------------------------------------------------------- /devhelp/devhelp.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2012 Aleksander Morgado 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #ifndef DEVHELP_H 22 | #define DEVHELP_H 23 | 24 | /* Include all the public headers. */ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | #endif /* DEVHELP_H */ 50 | -------------------------------------------------------------------------------- /devhelp/dh-application-window.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #include "dh-application-window.h" 22 | #include "dh-util-lib.h" 23 | 24 | /** 25 | * SECTION:dh-application-window 26 | * @Title: DhApplicationWindow 27 | * @Short_description: For the main application window 28 | * 29 | * Functions for the main application window. 30 | */ 31 | 32 | /** 33 | * dh_application_window_bind_sidebar_and_notebook: 34 | * @sidebar: a #DhSidebar. 35 | * @notebook: an empty #DhNotebook. 36 | * 37 | * Binds @sidebar and @notebook: 38 | * - When the #DhSidebar::link-selected signal is emitted, open the URI in the 39 | * active #DhWebView. 40 | * - On #GtkNotebook::switch-page or when the user clicks on a link, calls 41 | * dh_sidebar_select_uri() with the new active URI. 42 | * 43 | * You need to call this function when the #DhNotebook is empty, i.e. before 44 | * adding the first #DhTab. 45 | * 46 | * Note that this function doesn't take a “self” window parameter, to be more 47 | * flexible: it is possible to have several pairs of #DhSidebar/#DhNotebook per 48 | * window, to show different #DhProfile's. 49 | * 50 | * Since: 3.30 51 | */ 52 | void 53 | dh_application_window_bind_sidebar_and_notebook (DhSidebar *sidebar, 54 | DhNotebook *notebook) 55 | { 56 | g_return_if_fail (DH_IS_SIDEBAR (sidebar)); 57 | g_return_if_fail (DH_IS_NOTEBOOK (notebook)); 58 | g_return_if_fail (dh_notebook_get_active_tab (notebook) == NULL); 59 | 60 | /* Have the implementation separate from dh-application-window, because 61 | * it is planned to have a real DhApplicationWindow class in the 62 | * libdevhelp that will have similar signal handlers, it would be 63 | * confusing to have two times the same signal handlers. 64 | * 65 | * API design: 66 | * But the public function belongs to the window, since the window is 67 | * the container containing the two widgets. Another container 68 | * containing the two widgets, in the Devhelp app, is the horizontal 69 | * GtkPaned, but it would have been less flexible to create a GtkPaned 70 | * subclass with the bind() function, because it would have forced an 71 | * IDE to use GtkPaned to be able to bind the two widgets (an IDE may 72 | * want to use something else than a GtkPaned). 73 | */ 74 | _dh_util_bind_sidebar_and_notebook (sidebar, notebook); 75 | } 76 | -------------------------------------------------------------------------------- /devhelp/dh-application-window.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | void dh_application_window_bind_sidebar_and_notebook (DhSidebar *sidebar, 30 | DhNotebook *notebook); 31 | 32 | G_END_DECLS 33 | 34 | -------------------------------------------------------------------------------- /devhelp/dh-assistant-view.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2008 Sven Herzberg 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define DH_TYPE_ASSISTANT_VIEW (dh_assistant_view_get_type ()) 29 | G_DECLARE_DERIVABLE_TYPE (DhAssistantView, dh_assistant_view, DH, ASSISTANT_VIEW, WebKitWebView) 30 | 31 | struct _DhAssistantViewClass { 32 | WebKitWebViewClass parent_class; 33 | 34 | /* Padding for future expansion */ 35 | gpointer padding[12]; 36 | }; 37 | 38 | GtkWidget *dh_assistant_view_new (void); 39 | gboolean dh_assistant_view_set_link (DhAssistantView *view, 40 | DhLink *link); 41 | gboolean dh_assistant_view_search (DhAssistantView *view, 42 | const gchar *str); 43 | G_END_DECLS 44 | 45 | -------------------------------------------------------------------------------- /devhelp/dh-book-list-builder.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define DH_TYPE_BOOK_LIST_BUILDER (dh_book_list_builder_get_type ()) 30 | G_DECLARE_DERIVABLE_TYPE (DhBookListBuilder, dh_book_list_builder, DH, BOOK_LIST_BUILDER, GObject) 31 | 32 | struct _DhBookListBuilderClass { 33 | GObjectClass parent_class; 34 | 35 | /* Padding for future expansion */ 36 | gpointer padding[12]; 37 | }; 38 | 39 | DhBookListBuilder *dh_book_list_builder_new (void); 40 | void dh_book_list_builder_add_sub_book_list (DhBookListBuilder *builder, 41 | DhBookList *sub_book_list); 42 | void dh_book_list_builder_add_default_sub_book_lists (DhBookListBuilder *builder, 43 | gint scale); 44 | void dh_book_list_builder_read_books_disabled_setting (DhBookListBuilder *builder, 45 | DhSettings *settings); 46 | DhBookList *dh_book_list_builder_create_object (DhBookListBuilder *builder); 47 | 48 | G_END_DECLS 49 | 50 | -------------------------------------------------------------------------------- /devhelp/dh-book-list-directory.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define DH_TYPE_BOOK_LIST_DIRECTORY (dh_book_list_directory_get_type ()) 29 | G_DECLARE_DERIVABLE_TYPE (DhBookListDirectory, dh_book_list_directory, DH, BOOK_LIST_DIRECTORY, DhBookList) 30 | 31 | struct _DhBookListDirectoryClass { 32 | DhBookListClass parent_class; 33 | 34 | /* Padding for future expansion */ 35 | gpointer padding[12]; 36 | }; 37 | 38 | DhBookListDirectory *dh_book_list_directory_new (GFile *directory, gint scale); 39 | GFile *dh_book_list_directory_get_directory (DhBookListDirectory *list_directory); 40 | 41 | G_END_DECLS 42 | 43 | -------------------------------------------------------------------------------- /devhelp/dh-book-list-simple.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include "dh-book-list.h" 25 | #include "dh-settings.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define DH_TYPE_BOOK_LIST_SIMPLE (dh_book_list_simple_get_type ()) 30 | G_DECLARE_DERIVABLE_TYPE (DhBookListSimple, dh_book_list_simple, DH, BOOK_LIST_SIMPLE, DhBookList) 31 | 32 | struct _DhBookListSimpleClass { 33 | DhBookListClass parent_class; 34 | 35 | /* Padding for future expansion */ 36 | gpointer padding[12]; 37 | }; 38 | 39 | G_GNUC_INTERNAL 40 | DhBookList *_dh_book_list_simple_new (GList *sub_book_lists, 41 | DhSettings *settings); 42 | G_END_DECLS 43 | 44 | -------------------------------------------------------------------------------- /devhelp/dh-book-list.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define DH_TYPE_BOOK_LIST (dh_book_list_get_type ()) 29 | G_DECLARE_DERIVABLE_TYPE (DhBookList, dh_book_list, DH, BOOK_LIST, GObject) 30 | 31 | /** 32 | * DhBookListClass: 33 | * @parent_class: The parent class. 34 | * @add_book: Virtual function pointer for the #DhBookList::add-book signal. 35 | * @remove_book: Virtual function pointer for the #DhBookList::remove-book 36 | * signal. 37 | * @get_books: Virtual function pointer for dh_book_list_get_books(). Returns 38 | * the #DhBookList internal #GList by default. If you override this vfunc 39 | * ensure that each book ID is unique in the returned list. 40 | */ 41 | struct _DhBookListClass { 42 | GObjectClass parent_class; 43 | 44 | /* Signals */ 45 | void (* add_book) (DhBookList *book_list, 46 | DhBook *book); 47 | void (* remove_book) (DhBookList *book_list, 48 | DhBook *book); 49 | /* Vfuncs */ 50 | GList * (* get_books) (DhBookList *book_list); 51 | void * (* set_books) (DhBookList *book_list, GList *books); 52 | void (* refresh) (DhBookList *book_list); 53 | 54 | /* Padding for future expansion */ 55 | gpointer padding[12]; 56 | }; 57 | 58 | 59 | DhBookList *dh_book_list_new (void); 60 | DhBookList *dh_book_list_get_default (gint scale); 61 | void dh_book_list_refresh (DhBookList* book_list); 62 | G_GNUC_INTERNAL 63 | void _dh_book_list_unref_default (void); 64 | GList *dh_book_list_get_books (DhBookList *book_list); 65 | GList *dh_book_list_set_books (DhBookList *book_list, GList *books); 66 | void dh_book_list_add_book (DhBookList *book_list, 67 | DhBook *book); 68 | void dh_book_list_remove_book (DhBookList *book_list, 69 | DhBook *book); 70 | 71 | G_END_DECLS 72 | 73 | -------------------------------------------------------------------------------- /devhelp/dh-book-manager.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2002 CodeFactory AB 6 | * Copyright (C) 2002 Mikael Hallendal 7 | * Copyright (C) 2004-2008 Imendio AB 8 | * Copyright (C) 2010 Lanedo GmbH 9 | * Copyright (C) 2012 Thomas Bechtold 10 | * Copyright (C) 2017, 2018 Sébastien Wilmet 11 | * 12 | * Devhelp is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published 14 | * by the Free Software Foundation, either version 3 of the License, 15 | * or (at your option) any later version. 16 | * 17 | * Devhelp is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with Devhelp. If not, see . 24 | */ 25 | 26 | #include "dh-book-manager.h" 27 | 28 | /** 29 | * SECTION:dh-book-manager 30 | * @Title: DhBookManager 31 | * @Short_description: Aggregation of all #DhBook's 32 | * 33 | * #DhBookManager was a singleton class containing all the #DhBook's. It is now 34 | * empty. 35 | * 36 | * 37 | * This class is entirely deprecated, you need to use #DhProfile, #DhSettings 38 | * and #DhBookList instead. 39 | * 40 | */ 41 | 42 | struct _DhBookManager { 43 | GObject parent_instance; 44 | }; 45 | 46 | G_DEFINE_TYPE (DhBookManager, dh_book_manager, G_TYPE_OBJECT); 47 | 48 | static void 49 | dh_book_manager_class_init (DhBookManagerClass *klass) 50 | { 51 | } 52 | 53 | static void 54 | dh_book_manager_init (DhBookManager *book_manager) 55 | { 56 | 57 | } 58 | 59 | /** 60 | * dh_book_manager_new: 61 | * 62 | * Returns: (transfer full): a new #DhBookManager object. 63 | * Deprecated: 3.26: the #DhBookManager class is deprecated. 64 | */ 65 | DhBookManager * 66 | dh_book_manager_new () 67 | { 68 | return g_object_new (DH_TYPE_BOOK_MANAGER, NULL); 69 | } 70 | 71 | /** 72 | * dh_book_manager_populate: 73 | * @book_manager: a #DhBookManager. 74 | * 75 | * Deprecated: 3.26: the #DhBookManager class is deprecated. 76 | */ 77 | void 78 | dh_book_manager_populate (DhBookManager *book_manager) 79 | { 80 | } 81 | -------------------------------------------------------------------------------- /devhelp/dh-book-manager.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2010 Lanedo GmbH 6 | * Copyright (C) 2017, 2018 Sébastien Wilmet 7 | * 8 | * Devhelp is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, 11 | * or (at your option) any later version. 12 | * 13 | * Devhelp is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with Devhelp. If not, see . 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define DH_TYPE_BOOK_MANAGER (dh_book_manager_get_type ()) 29 | G_DECLARE_FINAL_TYPE (DhBookManager, dh_book_manager, DH, BOOK_MANAGER, GObject) 30 | 31 | G_DEPRECATED 32 | DhBookManager *dh_book_manager_new (void); 33 | G_DEPRECATED 34 | void dh_book_manager_populate (DhBookManager *book_manager); 35 | 36 | G_END_DECLS 37 | 38 | -------------------------------------------------------------------------------- /devhelp/dh-book-tree-model.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * Copyright (C) 2018 Jerzy Kozera 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, see . 17 | */ 18 | 19 | #ifndef DH_BOOK_TREE_MODEL_H 20 | #define DH_BOOK_TREE_MODEL_H 21 | 22 | #include 23 | #include 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define DH_TYPE_BOOK_TREE_MODEL (dh_book_tree_model_get_type ()) 28 | #define DH_BOOK_TREE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DH_TYPE_BOOK_TREE_MODEL, DhBookTreeModel)) 29 | #define DH_BOOK_TREE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DH_TYPE_BOOK_TREE_MODEL, DhBookTreeModelClass)) 30 | #define DH_IS_BOOK_TREE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DH_TYPE_BOOK_TREE_MODEL)) 31 | #define DH_IS_BOOK_TREE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DH_TYPE_BOOK_TREE_MODEL)) 32 | #define DH_BOOK_TREE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DH_TYPE_BOOK_TREE_MODEL, DhBookTreeModelClass)) 33 | 34 | typedef struct _DhBookTreeModel DhBookTreeModel; 35 | typedef struct _DhBookTreeModelClass DhBookTreeModelClass; 36 | 37 | struct _DhBookTreeModel { 38 | GObject parent_instance; 39 | }; 40 | 41 | struct _DhBookTreeModelClass { 42 | GObjectClass parent_class; 43 | 44 | /* Padding for future expansion */ 45 | gpointer padding[12]; 46 | }; 47 | 48 | enum { 49 | DH_BOOK_TREE_MODEL_COL_TITLE, 50 | DH_BOOK_TREE_MODEL_COL_LINK, 51 | DH_BOOK_TREE_MODEL_COL_BOOK, 52 | DH_BOOK_TREE_MODEL_COL_WEIGHT, 53 | DH_BOOK_TREE_MODEL_COL_UNDERLINE, 54 | DH_BOOK_TREE_MODEL_COL_ICON, 55 | DH_BOOK_TREE_MODEL_COL_ICON_B64, 56 | DH_BOOK_TREE_MODEL_NUM_COLS 57 | }; 58 | 59 | 60 | GType dh_book_tree_model_get_type (void); 61 | 62 | DhBookTreeModel *dh_book_tree_model_new (gboolean group_by_language, gint scale); 63 | 64 | G_END_DECLS 65 | 66 | #endif /* DH_BOOK_TREE_MODEL_H */ 67 | -------------------------------------------------------------------------------- /devhelp/dh-book-tree.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2001 Mikael Hallendal 6 | * Copyright (C) 2018 Sébastien Wilmet 7 | * 8 | * Devhelp is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, 11 | * or (at your option) any later version. 12 | * 13 | * Devhelp is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with Devhelp. If not, see . 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define DH_TYPE_BOOK_TREE (dh_book_tree_get_type ()) 31 | G_DECLARE_FINAL_TYPE (DhBookTree, dh_book_tree, DH, BOOK_TREE, GtkTreeView) 32 | 33 | DhBookTree *dh_book_tree_new (DhProfile *profile); 34 | DhProfile *dh_book_tree_get_profile (DhBookTree *tree); 35 | DhLink *dh_book_tree_get_selected_link (DhBookTree *tree); 36 | void dh_book_tree_select_uri (DhBookTree *tree, 37 | const gchar *uri); 38 | void dh_book_tree_set_filter (DhBookTree *tree, 39 | const GString *filter); 40 | 41 | G_END_DECLS 42 | 43 | -------------------------------------------------------------------------------- /devhelp/dh-book.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2002 CodeFactory AB 6 | * Copyright (C) 2002 Mikael Hallendal 7 | * Copyright (C) 2005-2008 Imendio AB 8 | * Copyright (C) 2010 Lanedo GmbH 9 | * Copyright (C) 2017, 2018 Sébastien Wilmet 10 | * 11 | * Devhelp is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published 13 | * by the Free Software Foundation, either version 3 of the License, 14 | * or (at your option) any later version. 15 | * 16 | * Devhelp is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with Devhelp. If not, see . 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | #define DH_TYPE_BOOK (dh_book_get_type ()) 36 | G_DECLARE_DERIVABLE_TYPE (DhBook, dh_book, DH, BOOK, GObject) 37 | 38 | struct _DhBookClass { 39 | GObjectClass parent_class; 40 | 41 | /* Padding for future expansion */ 42 | gpointer padding[12]; 43 | }; 44 | 45 | 46 | DhBook *dh_book_new (GFile *index_file); 47 | DhBook * dh_book_new_from_json (JsonObject *object, gint scale); 48 | GFile *dh_book_get_index_file (DhBook *book); 49 | const gchar *dh_book_get_id (DhBook *book); 50 | const gchar *dh_book_get_id_for_removing (DhBook *book); 51 | cairo_surface_t* dh_book_get_icon_surface (DhBook *book); 52 | const gchar* dh_book_get_icon_b64 (DhBook *book); 53 | const gchar *dh_book_get_title (DhBook *book); 54 | const gchar *dh_book_get_language (DhBook *book); 55 | GList *dh_book_get_links (DhBook *book); 56 | GNode *dh_book_get_tree (DhBook *book); 57 | DhCompletion *dh_book_get_completion (DhBook *book); 58 | gint dh_book_cmp_by_id (DhBook *a, 59 | DhBook *b); 60 | gint dh_book_cmp_by_title (DhBook *a, 61 | DhBook *b); 62 | G_END_DECLS 63 | 64 | -------------------------------------------------------------------------------- /devhelp/dh-completion.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | 25 | G_BEGIN_DECLS 26 | 27 | #define DH_TYPE_COMPLETION (dh_completion_get_type ()) 28 | G_DECLARE_DERIVABLE_TYPE (DhCompletion, dh_completion, DH, COMPLETION, GObject) 29 | 30 | struct _DhCompletionClass { 31 | GObjectClass parent_class; 32 | 33 | /* Padding for future expansion */ 34 | gpointer padding[12]; 35 | }; 36 | 37 | DhCompletion *dh_completion_new (void); 38 | void dh_completion_add_string (DhCompletion *completion, 39 | const gchar *str); 40 | void dh_completion_sort (DhCompletion *completion); 41 | gchar *dh_completion_complete (DhCompletion *completion, 42 | const gchar *prefix); 43 | gchar *dh_completion_aggregate_complete (GList *completion_objects, 44 | const gchar *prefix); 45 | 46 | G_END_DECLS 47 | 48 | -------------------------------------------------------------------------------- /devhelp/dh-error.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2002 CodeFactory AB 6 | * Copyright (C) 2002 Mikael Hallendal 7 | * Copyright (C) 2018 Sébastien Wilmet 8 | * 9 | * Devhelp is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * Devhelp is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with Devhelp. If not, see . 21 | */ 22 | 23 | #include "dh-error.h" 24 | 25 | GQuark 26 | _dh_error_quark (void) 27 | { 28 | static GQuark quark = 0; 29 | 30 | if (quark == 0) 31 | quark = g_quark_from_static_string ("libdevhelp-error-quark"); 32 | 33 | return quark; 34 | } 35 | -------------------------------------------------------------------------------- /devhelp/dh-error.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2002 CodeFactory AB 6 | * Copyright (C) 2002 Mikael Hallendal 7 | * Copyright (C) 2018 Sébastien Wilmet 8 | * 9 | * Devhelp is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * Devhelp is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with Devhelp. If not, see . 21 | */ 22 | 23 | #ifndef DH_ERROR_H 24 | #define DH_ERROR_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define DH_ERROR _dh_error_quark () 31 | 32 | typedef enum { 33 | DH_ERROR_MALFORMED_BOOK 34 | } DhError; 35 | 36 | G_GNUC_INTERNAL 37 | GQuark _dh_error_quark (void); 38 | 39 | G_END_DECLS 40 | 41 | #endif /* DH_ERROR_H */ 42 | -------------------------------------------------------------------------------- /devhelp/dh-groupdialog.vala: -------------------------------------------------------------------------------- 1 | using Gtk; 2 | 3 | [GtkTemplate (ui="/org/gnome/devhelp/dh-groupdialog.ui")] 4 | public class DhGroupDialog : Dialog { 5 | [GtkChild] 6 | private FlowBox icons_flow_box; 7 | 8 | [GtkChild] 9 | private ScrolledWindow icons_scrolled_window; 10 | 11 | private Button name_button; 12 | 13 | private string current_text; 14 | private string current_letter; 15 | private string group_id; 16 | private string docset_id; 17 | 18 | public DhGroupDialog (string docset_id) { 19 | foreach (string s in IconTheme.get_default().list_icons("Categories")) { 20 | Image image = new Image.from_icon_name(s, IconSize.LARGE_TOOLBAR); 21 | this.icons_flow_box.add(image); 22 | image.show(); 23 | } 24 | 25 | CssProvider css = new CssProvider(); 26 | css.load_from_data("* { padding: 2pt 2pt; }"); 27 | Box bbox = new Box(Orientation.HORIZONTAL, 1); 28 | this.name_button = new Button(); 29 | bbox.add(this.name_button); 30 | bbox.set_halign(Align.CENTER); 31 | this.name_button.set_label("A"); 32 | this.name_button.clicked.connect(this.name_button_clicked); 33 | bbox.show_all(); 34 | this.name_button.get_style_context().add_provider(css, STYLE_PROVIDER_PRIORITY_APPLICATION); 35 | this.icons_flow_box.insert(bbox, 0); 36 | this.current_text = ""; 37 | this.current_letter = "A"; 38 | this.docset_id = docset_id; 39 | } 40 | 41 | private void name_button_clicked () { 42 | this.icons_flow_box.select_child( 43 | this.icons_flow_box.get_child_at_index(0) 44 | ); 45 | } 46 | 47 | [GtkCallback] 48 | private void text_changed (Editable widget) { 49 | this.current_text = widget.get_chars(); 50 | if (current_text != "") { 51 | current_letter = current_text.slice(0, 1); 52 | this.name_button.set_label(current_letter); 53 | } 54 | } 55 | 56 | [GtkCallback] 57 | private void save_clicked () { 58 | Soup.Session session = new Soup.Session(); 59 | Soup.Message msg = new Soup.Message("POST", "http://localhost:12340/group"); 60 | Json.Object object = new Json.Object(); 61 | object.set_string_member("Icon", this.get_current_icon()); 62 | object.set_string_member("Name", this.get_current_text()); 63 | Json.Node node = new Json.Node(Json.NodeType.OBJECT); 64 | node.set_object(object); 65 | msg.set_request( 66 | "application/json", 67 | Soup.MemoryUse.COPY, 68 | (uint8[])Json.to_string(node, false).to_utf8() 69 | ); 70 | GLib.InputStream result = session.send(msg, null); 71 | GLib.DataInputStream result_data = new GLib.DataInputStream(result); 72 | group_id = result_data.read_line(); 73 | 74 | msg = new Soup.Message("POST", "http://localhost:12340/group/" + group_id + "/doc"); 75 | msg.set_request( 76 | "text/plain", 77 | Soup.MemoryUse.COPY, 78 | (uint8[])this.docset_id.to_utf8() 79 | ); 80 | session.send(msg); 81 | 82 | this.response(ResponseType.OK); 83 | } 84 | 85 | [GtkCallback] 86 | private void cancel_clicked () { 87 | this.response(ResponseType.CANCEL); 88 | } 89 | 90 | public string get_current_text() { 91 | return current_text; 92 | } 93 | 94 | public string get_group_id() { 95 | return group_id; 96 | } 97 | 98 | public string get_current_icon() { 99 | FlowBoxChild fb_child = this.icons_flow_box.get_selected_children().first().data; 100 | if (fb_child.get_index() == 0) { 101 | return current_letter; 102 | } 103 | Image image = (Image)(fb_child.get_child()); 104 | IconSize size; 105 | string icon; 106 | image.get_icon_name(out icon, out size); 107 | return icon; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /devhelp/dh-init.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2012 Aleksander Morgado 6 | * Copyright (C) 2017 Sébastien Wilmet 7 | * 8 | * Devhelp is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, 11 | * or (at your option) any later version. 12 | * 13 | * Devhelp is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with Devhelp. If not, see . 20 | */ 21 | 22 | #include "config.h" 23 | #include "dh-init.h" 24 | #include 25 | #include "dh-book-list.h" 26 | #include "dh-profile.h" 27 | #include "dh-settings.h" 28 | 29 | /** 30 | * dh_init: 31 | * 32 | * Initializes the Devhelp library (e.g. for the internationalization). 33 | * 34 | * This function can be called several times, but is meant to be called at the 35 | * beginning of main(), before any other Devhelp function call. 36 | */ 37 | void 38 | dh_init (void) 39 | { 40 | static gboolean done = FALSE; 41 | 42 | if (!done) { 43 | bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); 44 | bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); 45 | done = TRUE; 46 | } 47 | } 48 | 49 | /** 50 | * dh_finalize: 51 | * 52 | * Free the resources allocated by Devhelp. For example it unrefs the singleton 53 | * objects. 54 | * 55 | * It is not mandatory to call this function, it's just to be friendlier to 56 | * memory debugging tools. This function is meant to be called at the end of 57 | * main(). It can be called several times. 58 | * 59 | * Since: 3.26 60 | */ 61 | 62 | /* Another way is to use a DSO destructor, see gconstructor.h in GLib. 63 | * 64 | * The advantage of calling dh_finalize() at the end of main() is that 65 | * gobject-list [1] correctly reports that all Dh* objects have been finalized 66 | * when quitting the application. On the other hand a DSO destructor runs after 67 | * the gobject-list's last output, so it's much less convenient, see: 68 | * https://gitlab.gnome.org/GNOME/gtksourceview/commit/e761de9c2bee90c232875bbc41e6e73e1f63e145 69 | * 70 | * [1] A tool for debugging the lifetime of GObjects: 71 | * https://github.com/danni/gobject-list 72 | */ 73 | void 74 | dh_finalize (void) 75 | { 76 | static gboolean done = FALSE; 77 | 78 | /* Unref the singletons only once, even if this function is called 79 | * multiple times, to see if a reference is not released correctly. 80 | * Normally the singletons have a ref count of 1. If for some reason the 81 | * ref count is increased somewhere, it needs to be decreased 82 | * accordingly, at the right place. 83 | */ 84 | if (!done) { 85 | _dh_book_list_unref_default (); 86 | _dh_profile_unref_default (); 87 | _dh_settings_unref_default (); 88 | done = TRUE; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /devhelp/dh-init.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2017 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #ifndef DH_INIT_H 22 | #define DH_INIT_H 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | void dh_init (void); 29 | void dh_finalize (void); 30 | 31 | G_END_DECLS 32 | 33 | #endif /* DH_INIT_H */ 34 | -------------------------------------------------------------------------------- /devhelp/dh-keyword-model.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2002 CodeFactory AB 6 | * Copyright (C) 2002 Mikael Hallendal 7 | * Copyright (C) 2018 Sébastien Wilmet 8 | * 9 | * Devhelp is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * Devhelp is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with Devhelp. If not, see . 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define DH_TYPE_KEYWORD_MODEL (dh_keyword_model_get_type ()) 33 | G_DECLARE_DERIVABLE_TYPE (DhKeywordModel, dh_keyword_model, DH, KEYWORD_MODEL, GObject) 34 | struct _DhKeywordModelClass { 35 | GObjectClass parent_class; 36 | 37 | /* Signals */ 38 | void (*filter_complete) (DhKeywordModel *model); 39 | 40 | /* Padding for future expansion */ 41 | gpointer padding[12]; 42 | }; 43 | 44 | enum { 45 | DH_KEYWORD_MODEL_COL_NAME, 46 | DH_KEYWORD_MODEL_COL_LINK, 47 | DH_KEYWORD_MODEL_COL_CURRENT_BOOK_FLAG, 48 | DH_KEYWORD_MODEL_NUM_COLS 49 | }; 50 | 51 | DhKeywordModel *dh_keyword_model_new (void); 52 | DhLink *dh_keyword_model_filter (DhKeywordModel *model, 53 | const gchar *search_string, 54 | const gchar *current_book_id, 55 | DhProfile *profile); 56 | void dh_keyword_model_set_group_id(DhKeywordModel *model, gchar *id); 57 | 58 | G_END_DECLS 59 | 60 | -------------------------------------------------------------------------------- /devhelp/dh-lib.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | dh-groupdialog.ui 5 | 6 | 7 | -------------------------------------------------------------------------------- /devhelp/dh-link.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2002 Mikael Hallendal 6 | * Copyright (C) 2008 Imendio AB 7 | * Copyright (C) 2017, 2018 Sébastien Wilmet 8 | * 9 | * Devhelp is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * Devhelp is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with Devhelp. If not, see . 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | /** 31 | * DhLinkType: 32 | * @DH_LINK_TYPE_BOOK: The top-level page of a #DhBook. 33 | * @DH_LINK_TYPE_PAGE: A page. 34 | * @DH_LINK_TYPE_KEYWORD: Another kind of keyword. 35 | * @DH_LINK_TYPE_FUNCTION: A function keyword. 36 | * @DH_LINK_TYPE_STRUCT: A struct keyword. 37 | * @DH_LINK_TYPE_MACRO: A macro keyword. 38 | * @DH_LINK_TYPE_ENUM: An enum keyword. 39 | * @DH_LINK_TYPE_TYPEDEF: A typedef keyword. 40 | * @DH_LINK_TYPE_PROPERTY: A property keyword. 41 | * @DH_LINK_TYPE_SIGNAL: A signal keyword. 42 | * 43 | * The type of the content the link points to. 44 | */ 45 | typedef enum { 46 | DH_LINK_TYPE_BOOK, 47 | DH_LINK_TYPE_PAGE, 48 | DH_LINK_TYPE_KEYWORD, 49 | DH_LINK_TYPE_FUNCTION, 50 | DH_LINK_TYPE_STRUCT, 51 | DH_LINK_TYPE_MACRO, 52 | DH_LINK_TYPE_ENUM, 53 | DH_LINK_TYPE_TYPEDEF, 54 | DH_LINK_TYPE_PROPERTY, 55 | DH_LINK_TYPE_SIGNAL 56 | } DhLinkType; 57 | 58 | /** 59 | * DhLinkFlags: 60 | * @DH_LINK_FLAGS_NONE: No flags set. 61 | * @DH_LINK_FLAGS_DEPRECATED: The symbol that the link points to is deprecated. 62 | */ 63 | typedef enum { 64 | DH_LINK_FLAGS_NONE = 0, 65 | DH_LINK_FLAGS_DEPRECATED = 1 << 0 66 | } DhLinkFlags; 67 | 68 | typedef struct _DhLink DhLink; 69 | 70 | #define DH_TYPE_LINK (dh_link_get_type ()) 71 | 72 | GType dh_link_get_type (void); 73 | 74 | DhLink * dh_link_new_book (const gchar *base_path, 75 | const gchar *book_id, 76 | const gchar *book_title, 77 | const gchar *relative_url); 78 | 79 | DhLink * dh_link_new (DhLinkType type, 80 | DhLink *book_link, 81 | const gchar *name, 82 | const gchar *relative_url); 83 | 84 | DhLink * dh_link_ref (DhLink *link); 85 | 86 | void dh_link_unref (DhLink *link); 87 | 88 | DhLinkType dh_link_get_link_type (DhLink *link); 89 | 90 | DhLinkFlags dh_link_get_flags (DhLink *link); 91 | 92 | void dh_link_set_flags (DhLink *link, 93 | DhLinkFlags flags); 94 | 95 | const gchar *dh_link_get_name (DhLink *link); 96 | 97 | gboolean dh_link_match_relative_url (DhLink *link, 98 | const gchar *relative_url); 99 | 100 | gboolean dh_link_belongs_to_page (DhLink *link, 101 | const gchar *page_id); 102 | 103 | gchar * dh_link_get_uri (DhLink *link); 104 | 105 | const gchar *dh_link_get_book_title (DhLink *link); 106 | 107 | const gchar *dh_link_get_book_id (DhLink *link); 108 | 109 | cairo_surface_t *dh_link_get_book_surface (DhLink *link); 110 | 111 | gint dh_link_compare (gconstpointer a, 112 | gconstpointer b); 113 | 114 | const gchar *dh_link_type_to_string (DhLinkType link_type); 115 | 116 | G_END_DECLS 117 | 118 | -------------------------------------------------------------------------------- /devhelp/dh-notebook.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define DH_TYPE_NOTEBOOK (dh_notebook_get_type ()) 31 | G_DECLARE_DERIVABLE_TYPE (DhNotebook, dh_notebook, DH, NOTEBOOK, GtkNotebook) 32 | 33 | struct _DhNotebookClass { 34 | GtkNotebookClass parent_class; 35 | 36 | /* Padding for future expansion */ 37 | gpointer padding[12]; 38 | }; 39 | 40 | DhNotebook *dh_notebook_new (DhProfile *profile); 41 | DhProfile *dh_notebook_get_profile (DhNotebook *notebook); 42 | void dh_notebook_open_new_tab (DhNotebook *notebook, 43 | const gchar *uri, 44 | gboolean switch_focus); 45 | DhTab *dh_notebook_get_active_tab (DhNotebook *notebook); 46 | DhWebView *dh_notebook_get_active_web_view (DhNotebook *notebook); 47 | GList *dh_notebook_get_all_web_views (DhNotebook *notebook); 48 | 49 | G_END_DECLS 50 | 51 | -------------------------------------------------------------------------------- /devhelp/dh-parser.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2003 CodeFactory AB 6 | * Copyright (C) 2003 Mikael Hallendal 7 | * Copyright (C) 2017, 2018 Sébastien Wilmet 8 | * 9 | * Devhelp is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * Devhelp is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with Devhelp. If not, see . 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | G_GNUC_INTERNAL 30 | gboolean _dh_parser_read_file (GFile *index_file, 31 | gchar **book_title, 32 | gchar **book_id, 33 | gchar **book_language, 34 | GNode **book_tree, 35 | GList **all_links, 36 | GError **error); 37 | 38 | G_END_DECLS 39 | 40 | -------------------------------------------------------------------------------- /devhelp/dh-profile-builder.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define DH_TYPE_PROFILE_BUILDER (dh_profile_builder_get_type ()) 31 | G_DECLARE_FINAL_TYPE (DhProfileBuilder, dh_profile_builder, DH, PROFILE_BUILDER, GObject) 32 | 33 | DhProfileBuilder *dh_profile_builder_new (void); 34 | void dh_profile_builder_set_settings (DhProfileBuilder *builder, 35 | DhSettings *settings); 36 | void dh_profile_builder_set_book_list (DhProfileBuilder *builder, 37 | DhBookList *book_list); 38 | DhProfile *dh_profile_builder_create_object (DhProfileBuilder *builder, gint scale); 39 | 40 | G_END_DECLS 41 | 42 | -------------------------------------------------------------------------------- /devhelp/dh-profile.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define DH_TYPE_PROFILE (dh_profile_get_type ()) 30 | G_DECLARE_FINAL_TYPE (DhProfile, dh_profile, DH, PROFILE, GObject) 31 | 32 | G_GNUC_INTERNAL 33 | DhProfile *_dh_profile_new (DhSettings *settings, 34 | DhBookList *book_list); 35 | DhProfile *dh_profile_get_default (gint scale); 36 | G_GNUC_INTERNAL 37 | void _dh_profile_unref_default (void); 38 | DhSettings *dh_profile_get_settings (DhProfile *profile); 39 | DhBookList *dh_profile_get_book_list (DhProfile *profile); 40 | 41 | G_END_DECLS 42 | 43 | -------------------------------------------------------------------------------- /devhelp/dh-search-bar.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define DH_TYPE_SEARCH_BAR (dh_search_bar_get_type ()) 29 | G_DECLARE_DERIVABLE_TYPE (DhSearchBar, dh_search_bar, DH, SEARCH_BAR, GtkSearchBar) 30 | 31 | struct _DhSearchBarClass { 32 | GtkSearchBarClass parent_class; 33 | 34 | /* Padding for future expansion */ 35 | gpointer padding[12]; 36 | }; 37 | 38 | DhSearchBar *dh_search_bar_new (DhNotebook *notebook); 39 | DhNotebook *dh_search_bar_get_notebook (DhSearchBar *search_bar); 40 | 41 | G_END_DECLS 42 | 43 | -------------------------------------------------------------------------------- /devhelp/dh-search-context.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include "dh-book.h" 25 | #include "dh-link.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | /* DhSearchContext is a helper class for a search instance, with the search 30 | * string as data. 31 | */ 32 | 33 | struct _DhSearchContext { 34 | /* The content of the search string: */ 35 | 36 | gchar *book_id; 37 | gchar *page_id; 38 | 39 | // If non-NULL, contains at least one non-empty string. 40 | GStrv keywords; 41 | 42 | /* Derived data: */ 43 | 44 | // Element-type: KeywordData*. 45 | GSList *keywords_data; 46 | 47 | gchar *joined_keywords; 48 | 49 | guint case_sensitive : 1; 50 | }; 51 | 52 | typedef struct _DhSearchContext DhSearchContext; 53 | 54 | G_GNUC_INTERNAL 55 | DhSearchContext * _dh_search_context_new (const gchar *search_string); 56 | 57 | G_GNUC_INTERNAL 58 | void _dh_search_context_free (DhSearchContext *search); 59 | 60 | G_GNUC_INTERNAL 61 | const gchar * _dh_search_context_get_book_id (DhSearchContext *search); 62 | 63 | G_GNUC_INTERNAL 64 | const gchar * _dh_search_context_get_page_id (DhSearchContext *search); 65 | 66 | G_GNUC_INTERNAL 67 | GStrv _dh_search_context_get_keywords (DhSearchContext *search); 68 | 69 | G_GNUC_INTERNAL 70 | gboolean _dh_search_context_get_case_sensitive (DhSearchContext *search); 71 | 72 | G_GNUC_INTERNAL 73 | gboolean _dh_search_context_match_book (DhSearchContext *search, 74 | DhBook *book); 75 | 76 | G_GNUC_INTERNAL 77 | gboolean _dh_search_context_match_link (DhSearchContext *search, 78 | DhLink *link, 79 | gboolean prefix); 80 | 81 | G_GNUC_INTERNAL 82 | gboolean _dh_search_context_is_exact_link (DhSearchContext *search, 83 | DhLink *link); 84 | 85 | G_END_DECLS 86 | 87 | -------------------------------------------------------------------------------- /devhelp/dh-settings-builder.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define DH_TYPE_SETTINGS_BUILDER (dh_settings_builder_get_type ()) 29 | G_DECLARE_FINAL_TYPE (DhSettingsBuilder, dh_settings_builder, DH, SETTINGS_BUILDER, GObject) 30 | 31 | DhSettingsBuilder *dh_settings_builder_new (void); 32 | void dh_settings_builder_set_contents_path (DhSettingsBuilder *builder, 33 | const gchar *contents_path); 34 | void dh_settings_builder_set_fonts_path (DhSettingsBuilder *builder, 35 | const gchar *fonts_path); 36 | DhSettings *dh_settings_builder_create_object (DhSettingsBuilder *builder); 37 | G_END_DECLS 38 | 39 | -------------------------------------------------------------------------------- /devhelp/dh-settings.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2012 Thomas Bechtold 6 | * Copyright (C) 2017, 2018 Sébastien Wilmet 7 | * 8 | * Devhelp is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, 11 | * or (at your option) any later version. 12 | * 13 | * Devhelp is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with Devhelp. If not, see . 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define DH_TYPE_SETTINGS (dh_settings_get_type ()) 30 | G_DECLARE_DERIVABLE_TYPE (DhSettings, dh_settings, DH, SETTINGS, GObject) 31 | 32 | struct _DhSettingsClass { 33 | GObjectClass parent; 34 | 35 | /* Signals */ 36 | void (* books_disabled_changed) (DhSettings *settings); 37 | void (* fonts_changed) (DhSettings *settings); 38 | 39 | /* Padding for future expansion */ 40 | gpointer padding[12]; 41 | }; 42 | 43 | G_GNUC_INTERNAL 44 | DhSettings *_dh_settings_new (const gchar *contents_path, 45 | const gchar *fonts_path); 46 | DhSettings *dh_settings_get_default (void); 47 | G_GNUC_INTERNAL 48 | 49 | void _dh_settings_unref_default (void); 50 | void dh_settings_bind_all (DhSettings *settings); 51 | gboolean dh_settings_get_group_books_by_language (DhSettings *settings); 52 | void dh_settings_set_group_books_by_language (DhSettings *settings, 53 | gboolean group_books_by_language); 54 | void dh_settings_bind_group_books_by_language (DhSettings *settings); 55 | gboolean dh_settings_is_book_enabled (DhSettings *settings, 56 | DhBook *book); 57 | void dh_settings_set_book_enabled (DhSettings *settings, 58 | DhBook *book, 59 | gboolean enabled); 60 | void dh_settings_freeze_books_disabled_changed (DhSettings *settings); 61 | void dh_settings_thaw_books_disabled_changed (DhSettings *settings); 62 | void dh_settings_get_selected_fonts (DhSettings *settings, 63 | gchar **variable_font, 64 | gchar **fixed_font); 65 | gboolean dh_settings_get_use_system_fonts (DhSettings *settings); 66 | gboolean dh_settings_get_dark_mode (DhSettings *settings); 67 | 68 | void dh_settings_set_use_system_fonts (DhSettings *settings, 69 | gboolean use_system_fonts); 70 | void dh_settings_set_dark_mode (DhSettings *settings, 71 | gboolean dark_mode); 72 | 73 | const gchar *dh_settings_get_variable_font (DhSettings *settings); 74 | void dh_settings_set_variable_font (DhSettings *settings, 75 | const gchar *variable_font); 76 | const gchar *dh_settings_get_fixed_font (DhSettings *settings); 77 | void dh_settings_set_fixed_font (DhSettings *settings, 78 | const gchar *fixed_font); 79 | void dh_settings_bind_fonts (DhSettings *settings); 80 | 81 | G_END_DECLS 82 | 83 | -------------------------------------------------------------------------------- /devhelp/dh-sidebar.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2001-2002 CodeFactory AB 6 | * Copyright (C) 2001-2002 Mikael Hallendal 7 | * Copyright (C) 2013 Aleksander Morgado 8 | * Copyright (C) 2017, 2018 Sébastien Wilmet 9 | * 10 | * Devhelp is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published 12 | * by the Free Software Foundation, either version 3 of the License, 13 | * or (at your option) any later version. 14 | * 15 | * Devhelp is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with Devhelp. If not, see . 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define DH_TYPE_SIDEBAR (dh_sidebar_get_type ()) 34 | G_DECLARE_DERIVABLE_TYPE (DhSidebar, dh_sidebar, DH, SIDEBAR, GtkGrid) 35 | 36 | struct _DhSidebarClass { 37 | GtkGridClass parent_class; 38 | 39 | /* Signals */ 40 | void (*link_selected) (DhSidebar *sidebar, 41 | DhLink *link); 42 | 43 | /* Padding for future expansion */ 44 | gpointer padding[12]; 45 | }; 46 | 47 | G_DEPRECATED_FOR (dh_sidebar_new2) 48 | GtkWidget * dh_sidebar_new (DhBookManager *book_manager); 49 | 50 | DhSidebar * dh_sidebar_new2 (DhProfile *profile); 51 | 52 | DhProfile * dh_sidebar_get_profile (DhSidebar *sidebar); 53 | 54 | DhLink * dh_sidebar_get_selected_link (DhSidebar *sidebar); 55 | 56 | void dh_sidebar_select_uri (DhSidebar *sidebar, 57 | const gchar *uri); 58 | 59 | void dh_sidebar_set_search_string (DhSidebar *sidebar, 60 | const gchar *str); 61 | 62 | void dh_sidebar_set_search_focus (DhSidebar *sidebar); 63 | 64 | G_END_DECLS 65 | 66 | -------------------------------------------------------------------------------- /devhelp/dh-tab-label.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define DH_TYPE_TAB_LABEL (dh_tab_label_get_type ()) 29 | G_DECLARE_FINAL_TYPE (DhTabLabel, dh_tab_label, DH, TAB_LABEL, GtkGrid) 30 | 31 | GtkWidget *dh_tab_label_new (DhTab *tab); 32 | DhTab *dh_tab_label_get_tab (DhTabLabel *tab_label); 33 | 34 | G_END_DECLS 35 | 36 | -------------------------------------------------------------------------------- /devhelp/dh-tab.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define DH_TYPE_TAB (dh_tab_get_type ()) 29 | G_DECLARE_FINAL_TYPE (DhTab, dh_tab, DH, TAB, GtkGrid) 30 | 31 | DhTab *dh_tab_new (DhWebView *web_view); 32 | DhWebView *dh_tab_get_web_view (DhTab *tab); 33 | G_END_DECLS 34 | 35 | -------------------------------------------------------------------------------- /devhelp/dh-util-lib.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2001-2002 Mikael Hallendal 6 | * Copyright (C) 2004,2008 Imendio AB 7 | * Copyright (C) 2015, 2017, 2018 Sébastien Wilmet 8 | * 9 | * Devhelp is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * Devhelp is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with Devhelp. If not, see . 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | #include "dh-notebook.h" 27 | #include "dh-sidebar.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | G_GNUC_INTERNAL 32 | gchar * _dh_util_build_data_filename (const gchar *first_part, 33 | ...); 34 | 35 | G_GNUC_INTERNAL 36 | void _dh_util_ascii_strtitle (gchar *str); 37 | 38 | G_GNUC_INTERNAL 39 | gchar * _dh_util_create_data_uri_for_filename (const gchar *filename, 40 | const gchar *mime_type); 41 | 42 | G_GNUC_INTERNAL 43 | void _dh_util_queue_concat (GQueue *q1, 44 | GQueue *q2); 45 | 46 | G_GNUC_INTERNAL 47 | void _dh_util_free_book_tree (GNode *book_tree); 48 | 49 | G_GNUC_INTERNAL 50 | GSList * _dh_util_get_possible_index_files (GFile *book_directory); 51 | 52 | G_GNUC_INTERNAL 53 | void _dh_util_bind_sidebar_and_notebook (DhSidebar *sidebar, 54 | DhNotebook *notebook); 55 | G_GNUC_INTERNAL 56 | gint _dh_util_surface_scale (gint scale); 57 | 58 | G_END_DECLS 59 | 60 | -------------------------------------------------------------------------------- /devhelp/dh-web-view.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define DH_TYPE_WEB_VIEW (dh_web_view_get_type ()) 29 | G_DECLARE_DERIVABLE_TYPE (DhWebView, dh_web_view, DH, WEB_VIEW, WebKitWebView) 30 | 31 | struct _DhWebViewClass { 32 | WebKitWebViewClass parent_class; 33 | 34 | /* Signals */ 35 | void (* open_new_tab) (DhWebView *view, 36 | const gchar *uri); 37 | 38 | /* Padding for future expansion */ 39 | gpointer padding[12]; 40 | }; 41 | 42 | DhWebView *dh_web_view_new (DhProfile *profile); 43 | DhProfile *dh_web_view_get_profile (DhWebView *view); 44 | const gchar *dh_web_view_get_devhelp_title (DhWebView *view); 45 | void dh_web_view_set_search_text (DhWebView *view, 46 | const gchar *search_text); 47 | void dh_web_view_search_next (DhWebView *view); 48 | void dh_web_view_search_previous (DhWebView *view); 49 | gboolean dh_web_view_can_zoom_in (DhWebView *view); 50 | gboolean dh_web_view_can_zoom_out (DhWebView *view); 51 | gboolean dh_web_view_can_reset_zoom (DhWebView *view); 52 | void dh_web_view_zoom_in (DhWebView *view); 53 | void dh_web_view_zoom_out (DhWebView *view); 54 | void dh_web_view_reset_zoom (DhWebView *view); 55 | 56 | G_END_DECLS 57 | 58 | -------------------------------------------------------------------------------- /devhelp/future/README: -------------------------------------------------------------------------------- 1 | For the future. The code in this directory is not compiled (but has been tested 2 | when written of course). Instead of the code bit-rotting in a forgotten branch, 3 | have the code on git master to ensure to have a backup. And elsewhere in the 4 | git repo, be able to make references to the experiments done here. 5 | -------------------------------------------------------------------------------- /devhelp/future/dh-dconf-migration.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2018 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #ifndef DH_DCONF_MIGRATION_H 22 | #define DH_DCONF_MIGRATION_H 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | typedef struct _DhDconfMigration DhDconfMigration; 29 | 30 | G_GNUC_INTERNAL 31 | DhDconfMigration * _dh_dconf_migration_new (void); 32 | 33 | G_GNUC_INTERNAL 34 | void _dh_dconf_migration_free (DhDconfMigration *migration); 35 | 36 | G_GNUC_INTERNAL 37 | void _dh_dconf_migration_migrate_key (DhDconfMigration *migration, 38 | const gchar *new_key_path, 39 | const gchar *first_old_key_path, 40 | ...); 41 | 42 | G_END_DECLS 43 | 44 | #endif /* DH_DCONF_MIGRATION_H */ 45 | -------------------------------------------------------------------------------- /devhelp/symbol.map: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | dh_*; 4 | local: 5 | *; 6 | }; 7 | -------------------------------------------------------------------------------- /docs/reference/devhelp-docs.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | %gtkdocentities; 8 | ]> 9 | 10 | 11 | &package_name; &package_api_version; Reference Manual 12 | 13 | For &package_string;. 14 | 15 | 16 | 17 | 18 | API Reference 19 | 20 | 21 | General 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | The Data 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | Side Panel 40 | 41 | 42 | 43 | 44 | 45 | 46 | Viewing HTML Pages 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | Putting It All Together 56 | 57 | 58 | 59 | 60 | Assistant 61 | 62 | 63 | 64 | 65 | Misc 66 | 67 | 68 | 69 | 70 | Deprecated 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | Annexes 79 | 80 | 81 | Object Hierarchy 82 | 83 | 84 | 85 | 86 | 87 | 88 | API Index 89 | 90 | 91 | 92 | Index of deprecated API 93 | 94 | 95 | 96 | Index of new symbols in 3.26 97 | 98 | 99 | 100 | Index of new symbols in 3.28 101 | 102 | 103 | 104 | Index of new symbols in 3.30 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /docs/reference/meson.build: -------------------------------------------------------------------------------- 1 | subdir('xml') 2 | 3 | configure_file( 4 | input : 'devhelp-sections.txt', 5 | output : 'devhelp-@0@-sections.txt'.format(LIBDEVHELP_API_VERSION), 6 | configuration : configuration_data() # TODO use "copy : true" when Meson 0.47 is released. 7 | ) 8 | 9 | gtkdoc_module_name = 'devhelp-@0@'.format(LIBDEVHELP_API_VERSION) 10 | html_dir = join_paths(get_option('prefix'), GNOME.gtkdoc_html_dir(gtkdoc_module_name)) 11 | 12 | webkitgtk_dep = dependency(WEBKITGTK_DEP_STR) 13 | webkitgtk_prefix = webkitgtk_dep.get_pkgconfig_variable('prefix') 14 | 15 | GNOME.gtkdoc( 16 | gtkdoc_module_name, 17 | main_xml : 'devhelp-docs.xml', 18 | src_dir : include_directories('../../devhelp/'), 19 | dependencies : SHARED_LIBDEVHELP_DECLARED_DEP, 20 | scan_args : ['--rebuild-types'], 21 | gobject_typesfile : 'devhelp-@0@.types'.format(LIBDEVHELP_API_VERSION), 22 | fixxref_args : [ 23 | '--html-dir=@0@'.format(html_dir), 24 | '--extra-dir=@0@/share/gtk-doc/html/@1@'.format(webkitgtk_prefix, WEBKITGTK_DEP_STR) 25 | ], 26 | content_files : [ 27 | 'api-breaks.xml' 28 | ], 29 | ignore_headers : [ 30 | 'dh-book-list-simple.h', 31 | 'dh-dconf-migration.h', 32 | 'dh-error.h', 33 | 'dh-parser.h', 34 | 'dh-search-context.h', 35 | 'dh-util-lib.h' 36 | ], 37 | install : true 38 | ) 39 | -------------------------------------------------------------------------------- /docs/reference/xml/gtkdocentities.ent.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/reference/xml/meson.build: -------------------------------------------------------------------------------- 1 | gtkdocentities_conf_data = configuration_data() 2 | gtkdocentities_conf_data.set('PACKAGE_NAME', 'Devhelp') 3 | gtkdocentities_conf_data.set('PACKAGE_STRING', 'Devhelp @0@'.format(meson.project_version())) 4 | gtkdocentities_conf_data.set('PACKAGE_API_VERSION', LIBDEVHELP_API_VERSION) 5 | 6 | gtkdocentities_filename = 'gtkdocentities.ent' 7 | 8 | configure_file( 9 | input : gtkdocentities_filename + '.in', 10 | output : gtkdocentities_filename, 11 | configuration : gtkdocentities_conf_data 12 | ) 13 | -------------------------------------------------------------------------------- /flatpak/.gitignore: -------------------------------------------------------------------------------- 1 | devhelp 2 | repo 3 | .flatpak-builder/ 4 | -------------------------------------------------------------------------------- /flatpak/1-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm -rf devhelp/ repo/ 4 | flatpak-builder devhelp io.github.jkozera.ZevDocs.json || exit 1 5 | flatpak build-export repo zevdocs 6 | -------------------------------------------------------------------------------- /flatpak/2-add-remote.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | flatpak remote-add --user --no-gpg-verify zevdocs-repo repo 4 | -------------------------------------------------------------------------------- /flatpak/3-install-app.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | flatpak install --user devhelp-repo io.github.jkozera.ZevDocs 4 | flatpak update --user io.github.jkozera.ZevDocs 5 | -------------------------------------------------------------------------------- /flatpak/4-run-app.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | flatpak run io.github.jkozera.ZevDocs 4 | -------------------------------------------------------------------------------- /flatpak/5-teardown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | flatpak uninstall --user org.gnome.Devhelp 4 | flatpak remote-delete --user devhelp-repo 5 | rm -rf devhelp/ repo/ .flatpak-builder/ 6 | -------------------------------------------------------------------------------- /flatpak/README: -------------------------------------------------------------------------------- 1 | Flatpak for Devhelp 2 | =================== 3 | 4 | Scripts are provided to test easily the Flatpak manifest. 5 | 6 | TODO, longer-term, remove "--filesystem=host:ro" from the finish-args: 7 | https://bugzilla.gnome.org/show_bug.cgi?id=792068#c3 8 | -------------------------------------------------------------------------------- /flatpak/io.github.jkozera.ZevDocs.json: -------------------------------------------------------------------------------- 1 | { 2 | "app-id" : "io.github.jkozera.ZevDocs", 3 | "runtime" : "org.gnome.Sdk", 4 | "runtime-version" : "master", 5 | "sdk" : "org.gnome.Sdk", 6 | "command" : "zevdocs", 7 | "tags" : [ 8 | "nightly" 9 | ], 10 | "desktop-file-name-prefix" : "(Nightly) ", 11 | "rename-icon" : "zevdocs", 12 | "copy-icon" : true, 13 | "finish-args" : [ 14 | "--share=ipc", 15 | "--socket=x11", 16 | "--socket=wayland", 17 | "--share=network", 18 | "--device=dri", 19 | "--filesystem=host:ro", 20 | "--filesystem=xdg-run/dconf", 21 | "--filesystem=~/.config/dconf:ro", 22 | "--talk-name=ca.desrt.dconf", 23 | "--env=DCONF_USER_CONFIG_DIR=.config/dconf" 24 | ], 25 | "build-options" : { 26 | "cflags" : "-g -O0", 27 | "cxxflags" : "-O2 -g", 28 | "env" : { 29 | "V" : "1" 30 | } 31 | }, 32 | "cleanup" : [ 33 | "/include", 34 | "/lib/pkgconfig", 35 | "/share/pkgconfig", 36 | "/share/aclocal", 37 | "/man", 38 | "/share/man", 39 | "*.la", 40 | "*.a" 41 | ], 42 | "modules" : [ 43 | { 44 | "name" : "amtk", 45 | "buildsystem" : "autotools", 46 | "builddir" : true, 47 | "sources" : [ 48 | { 49 | "type" : "git", 50 | "url" : "https://git.gnome.org/browse/amtk" 51 | } 52 | ] 53 | }, 54 | { 55 | "name" : "zevdocs", 56 | "config-opts" : [ 57 | "-Dflatpak_build=true" 58 | ], 59 | "sources" : [ 60 | { 61 | "type" : "git", 62 | "url" : "git://gitub.com/jkozera/zevdocs", 63 | "branch" : "master" 64 | } 65 | ] 66 | } 67 | ] 68 | } 69 | -------------------------------------------------------------------------------- /flatpak/org.gnome.Devhelp.json: -------------------------------------------------------------------------------- 1 | { 2 | "app-id" : "org.gnome.Devhelp", 3 | "runtime" : "org.gnome.Sdk", 4 | "runtime-version" : "master", 5 | "sdk" : "org.gnome.Sdk", 6 | "command" : "devhelp", 7 | "tags" : [ 8 | "nightly" 9 | ], 10 | "desktop-file-name-prefix" : "(Nightly) ", 11 | "finish-args" : [ 12 | "--share=ipc", 13 | "--socket=x11", 14 | "--socket=wayland", 15 | "--device=dri", 16 | "--filesystem=host:ro", 17 | "--filesystem=xdg-run/dconf", 18 | "--filesystem=~/.config/dconf:ro", 19 | "--talk-name=ca.desrt.dconf", 20 | "--env=DCONF_USER_CONFIG_DIR=.config/dconf" 21 | ], 22 | "build-options" : { 23 | "cflags" : "-O2 -g", 24 | "cxxflags" : "-O2 -g", 25 | "env" : { 26 | "V" : "1" 27 | } 28 | }, 29 | "cleanup" : [ 30 | "/include", 31 | "/lib/pkgconfig", 32 | "/share/pkgconfig", 33 | "share/aclocal", 34 | "man", 35 | "share/man", 36 | "*.la", 37 | "*.a" 38 | ], 39 | "modules" : [ 40 | { 41 | "name" : "devhelp", 42 | "buildsystem" : "meson", 43 | "config-opts" : [ 44 | "-Dflatpak_build=true" 45 | ], 46 | "run-tests" : true, 47 | "sources" : [ 48 | { 49 | "type" : "git", 50 | "url" : "https://gitlab.gnome.org/GNOME/devhelp.git", 51 | "branch" : "master" 52 | } 53 | ] 54 | } 55 | ] 56 | } 57 | -------------------------------------------------------------------------------- /help/C/index.page: -------------------------------------------------------------------------------- 1 | 4 | Devhelp User Documentation 5 | 6 | -------------------------------------------------------------------------------- /help/C/search.page: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | Search in the side panel 11 | 12 | 13 |

How the search in the side panel works.

14 |
15 | 16 |
17 | Case sensitivity 18 |

19 | The search is case sensitive when there is an uppercase letter. If the 20 | search terms are all in lowercase, the search is case insensitive. It's 21 | like the “smartcase” feature present in some text editors. 22 |

23 |
24 | 25 |
26 | Glob-style pattern matching 27 |

28 | A search term can be a pattern containing ‘*’ and ‘?’ wildcards. ‘*’ 29 | matches an arbitrary, possibly empty, string; and ‘?’ matches an arbitrary 30 | character. 31 |

32 |
33 | 34 |
35 | Several search terms 36 |

37 | You can search with several search terms (separated by spaces). A symbol 38 | will match only if all the search terms individually match (not 39 | necessarily in the same order of appearance). 40 |

41 |

42 | Note that it is different than searching with the ‘*’ wildcard: with the 43 | ‘*’ wildcard it forces the keywords to be in the same order. 44 |

45 |

46 | For example when searching “gtk window application”, it 47 | matches both “gtk_window_get_application()” and 48 | “GtkApplicationWindow” (among other symbols). 49 |

50 |

51 | On the other hand, searching “gtk*window*application” will 52 | match “gtk_window_get_application()” but not 53 | “GtkApplicationWindow”. 54 |

55 |
56 |
57 | -------------------------------------------------------------------------------- /help/LINGUAS: -------------------------------------------------------------------------------- 1 | cs 2 | de 3 | es 4 | hr 5 | hu 6 | pl 7 | pt_BR 8 | sv -------------------------------------------------------------------------------- /help/cs/cs.po: -------------------------------------------------------------------------------- 1 | # Czech translation for devhelp. 2 | # Copyright (C) 2018 devhelp's COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the devhelp package. 4 | # FIRST AUTHOR , YEAR. 5 | # Marek Černocký , 2018. 6 | # 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: devhelp master\n" 10 | "POT-Creation-Date: 2018-02-27 13:07+0000\n" 11 | "PO-Revision-Date: 2018-03-03 07:41+0100\n" 12 | "Last-Translator: Marek Černocký \n" 13 | "Language-Team: čeština \n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Language: cs\n" 18 | "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" 19 | "X-Generator: Gtranslator 2.91.7\n" 20 | 21 | #. (itstool) path: page/title 22 | #: C/index.page:4 23 | msgid "Devhelp User Documentation" 24 | msgstr "Uživatelská dokumentace k aplikaci Devhelp" 25 | 26 | #. Put one translator per line, in the form NAME , YEAR1, YEAR2 27 | msgctxt "_" 28 | msgid "translator-credits" 29 | msgstr "Marek Černocký " 30 | 31 | #. (itstool) path: page/title 32 | #: C/search.page:10 33 | msgid "Search in the side panel" 34 | msgstr "Hledání v postranním panelu" 35 | 36 | #. (itstool) path: synopsis/p 37 | #: C/search.page:13 38 | msgid "How the search in the side panel works." 39 | msgstr "Jak funguje hledání v postranním panelu." 40 | 41 | #. (itstool) path: section/title 42 | #: C/search.page:17 43 | msgid "Case sensitivity" 44 | msgstr "Rozlišování velikosti písmen" 45 | 46 | #. (itstool) path: section/p 47 | #: C/search.page:18 48 | msgid "" 49 | "The search is case sensitive when there is an uppercase letter. If the " 50 | "search terms are all in lowercase, the search is case insensitive. It's like " 51 | "the “smartcase” feature present in some text editors." 52 | msgstr "" 53 | "Při hledání se bere ohled na velikost písmen, když se ve výrazu objeví velké " 54 | "písmeno. Pokud jsou v hledaném výrazu jen samá malá písmena, nebere se " 55 | "velikost písmen při hledání v úvahu. Je to podobné, jako inteligentní práce " 56 | "s velikostí písmen v textových editorech, tzv. funkce „smartcase“." 57 | 58 | #. (itstool) path: section/title 59 | #: C/search.page:26 60 | msgid "Glob-style pattern matching" 61 | msgstr "Porovnávání podle globálního stylu vzorů" 62 | 63 | #. (itstool) path: section/p 64 | #: C/search.page:27 65 | msgid "" 66 | "A search term can be a pattern containing ‘*’ and ‘?’ wildcards. ‘*’ matches " 67 | "an arbitrary, possibly empty, string; and ‘?’ matches an arbitrary character." 68 | msgstr "" 69 | "Hledaný výraz může být vzor obsahující divoké znaky „*“ a „?“. „*“ vyhovuje " 70 | "cokoliv, včetně prázdného řetězce a „?“ vyhovuje právě jeden libovolný znak." 71 | 72 | #. (itstool) path: section/title 73 | #: C/search.page:35 74 | msgid "Several search terms" 75 | msgstr "Hledání několika výrazů" 76 | 77 | #. (itstool) path: section/p 78 | #: C/search.page:36 79 | msgid "" 80 | "You can search with several search terms (separated by spaces). A symbol " 81 | "will match only if all the search terms individually match (not " 82 | "necessarily in the same order of appearance)." 83 | msgstr "" 84 | "Můžete hledat několik výrazů naráz (oddělených mezerami). Symbol vyhoví " 85 | "hledání jen v případě, že se jednotlivě shodují všechny hledané " 86 | "výrazy (ne nutně ve stejném pořadí, jak byly zadány)." 87 | 88 | #. (itstool) path: section/p 89 | #: C/search.page:41 90 | msgid "" 91 | "Note that it is different than searching with the ‘*’ wildcard: with the ‘*’ " 92 | "wildcard it forces the keywords to be in the same order." 93 | msgstr "" 94 | "Pamatujte, že se to liší od hledání pomocí divokého znaku „*“: divoký znak " 95 | "„*“ si vynutí, aby byla klíčová slova ve stejném pořadí." 96 | 97 | #. (itstool) path: section/p 98 | #: C/search.page:45 99 | msgid "" 100 | "For example when searching “gtk window application”, it " 101 | "matches both “gtk_window_get_application()” and " 102 | "“GtkApplicationWindow” (among other symbols)." 103 | msgstr "" 104 | "Například, když hledáte „gtk window application“, bude tomu " 105 | "vyhovovat „gtk_window_get_application()“ a " 106 | "„GtkApplicationWindow“ (mimo jiné)." 107 | 108 | #. (itstool) path: section/p 109 | #: C/search.page:50 110 | msgid "" 111 | "On the other hand, searching “gtk*window*application” will " 112 | "match “gtk_window_get_application()” but not " 113 | "“GtkApplicationWindow”." 114 | msgstr "" 115 | "Na druhou stranu, hledání „gtk*window*application“ bude " 116 | "vyhovovat „gtk_window_get_application()“, ale " 117 | "„GtkApplicationWindow“ už ne." 118 | -------------------------------------------------------------------------------- /help/es/es.po: -------------------------------------------------------------------------------- 1 | # Spanish translation for devhelp. 2 | # Copyright (C) 2018 devhelp's COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the devhelp package. 4 | # Daniel Mustieles , 2018. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: devhelp master\n" 9 | "POT-Creation-Date: 2018-05-31 14:03+0000\n" 10 | "PO-Revision-Date: 2018-07-31 11:04+0200\n" 11 | "Last-Translator: Daniel Mustieles \n" 12 | "Language-Team: es \n" 13 | "Language: es\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 18 | "X-Generator: Gtranslator 2.91.7\n" 19 | 20 | #. (itstool) path: page/title 21 | #: C/index.page:4 22 | msgid "Devhelp User Documentation" 23 | msgstr "Documentación del usuario de Devhelp" 24 | 25 | #. Put one translator per line, in the form NAME , YEAR1, YEAR2 26 | msgctxt "_" 27 | msgid "translator-credits" 28 | msgstr "Daniel Mustieles , 2018" 29 | 30 | #. (itstool) path: page/title 31 | #: C/search.page:10 32 | msgid "Search in the side panel" 33 | msgstr "Búsqueda en el panel lateral" 34 | 35 | #. (itstool) path: synopsis/p 36 | #: C/search.page:13 37 | msgid "How the search in the side panel works." 38 | msgstr "Cómo funciona la búsqueda en el panel lateral." 39 | 40 | #. (itstool) path: section/title 41 | #: C/search.page:17 42 | msgid "Case sensitivity" 43 | msgstr "Distinguir mayúsculas y minúsculas" 44 | 45 | #. (itstool) path: section/p 46 | #: C/search.page:18 47 | msgid "" 48 | "The search is case sensitive when there is an uppercase letter. If the " 49 | "search terms are all in lowercase, the search is case insensitive. It's like " 50 | "the “smartcase” feature present in some text editors." 51 | msgstr "" 52 | "La búsqueda distingue entre mayúsculas y minúsculas cuando hay una letra " 53 | "mayúscula. Si todos los términos de la búsqueda están en minúsculas la " 54 | "búsqueda no hace esta distinción. Esto es como la característica de " 55 | "«mayúsculas y minúsculas inteligentes» de algunos editores de texto." 56 | 57 | #. (itstool) path: section/title 58 | #: C/search.page:26 59 | msgid "Glob-style pattern matching" 60 | msgstr "Coincidencia de patrones de tipo global" 61 | 62 | #. (itstool) path: section/p 63 | #: C/search.page:27 64 | msgid "" 65 | "A search term can be a pattern containing ‘*’ and ‘?’ wildcards. ‘*’ matches " 66 | "an arbitrary, possibly empty, string; and ‘?’ matches an arbitrary character." 67 | msgstr "" 68 | "Un término de búsqueda puede ser un patrón que contenga los comodines «?» y " 69 | "«*». El «*» busca un patrón arbitrario que puede estar vacío en una cadena; " 70 | "«?» busca un único carácter cualquiera." 71 | 72 | #. (itstool) path: section/title 73 | #: C/search.page:35 74 | msgid "Several search terms" 75 | msgstr "Varios términos de búsqueda" 76 | 77 | #. (itstool) path: section/p 78 | #: C/search.page:36 79 | msgid "" 80 | "You can search with several search terms (separated by spaces). A symbol " 81 | "will match only if all the search terms individually match (not " 82 | "necessarily in the same order of appearance)." 83 | msgstr "" 84 | "Puede buscar varios términos (separados por espacios). Un símbolo coincidirá " 85 | "sólo si todos los términos de la búsqueda coinciden individualmente " 86 | "(no necesariamente en el mismo orden de aparición)." 87 | 88 | #. (itstool) path: section/p 89 | #: C/search.page:41 90 | msgid "" 91 | "Note that it is different than searching with the ‘*’ wildcard: with the ‘*’ " 92 | "wildcard it forces the keywords to be in the same order." 93 | msgstr "" 94 | "Tenga en cuenta que esto es diferente de buscar con el comodín «*»: con " 95 | "dicho comodín se fuerza a buscar las palabras en el mismo orden." 96 | 97 | #. (itstool) path: section/p 98 | #: C/search.page:45 99 | msgid "" 100 | "For example when searching “gtk window application”, it " 101 | "matches both “gtk_window_get_application()” and " 102 | "“GtkApplicationWindow” (among other symbols)." 103 | msgstr "" 104 | "Por ejemplo, al buscar «gtk window application», esto " 105 | "coincide con «gtk_window_get_application()» y " 106 | "«GtkApplicationWindow» (entre otros símbolos)." 107 | 108 | #. (itstool) path: section/p 109 | #: C/search.page:50 110 | msgid "" 111 | "On the other hand, searching “gtk*window*application” will " 112 | "match “gtk_window_get_application()” but not " 113 | "“GtkApplicationWindow”." 114 | msgstr "" 115 | "Por otro lado, buscar «gtk*window*application» coincidirá con " 116 | "«gtk_window_get_application()» pero no con " 117 | "«GtkApplicationWindow»." 118 | -------------------------------------------------------------------------------- /help/hr/hr.po: -------------------------------------------------------------------------------- 1 | # Croatian translation for devhelp. 2 | # Copyright (C) 2018 devhelp's COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the devhelp package. 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: devhelp master\n" 8 | "POT-Creation-Date: 2018-02-22 11:16+0000\n" 9 | "PO-Revision-Date: 2018-02-26 16:37+0100\n" 10 | "Last-Translator: gogo \n" 11 | "Language-Team: \n" 12 | "MIME-Version: 1.0\n" 13 | "Content-Type: text/plain; charset=UTF-8\n" 14 | "Content-Transfer-Encoding: 8bit\n" 15 | "Language: hr\n" 16 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" 17 | "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" 18 | "X-Generator: Poedit 2.0.6\n" 19 | 20 | #. (itstool) path: page/title 21 | #: C/index.page:4 22 | msgid "Devhelp User Documentation" 23 | msgstr "Devhelp korisnička dokumentacija" 24 | 25 | #. Put one translator per line, in the form NAME , YEAR1, YEAR2 26 | msgctxt "_" 27 | msgid "translator-credits" 28 | msgstr "" 29 | "Launchpad Contributions:\n" 30 | " gogo https://launchpad.net/~trebelnik-stefina" 31 | 32 | #. (itstool) path: page/title 33 | #: C/search.page:10 34 | msgid "Search in the side panel" 35 | msgstr "Pretraži u bočnom panelu" 36 | 37 | #. (itstool) path: synopsis/p 38 | #: C/search.page:13 39 | msgid "How the search in the side panel works." 40 | msgstr "Kako radi pretraga u bočnom panelu." 41 | 42 | #. (itstool) path: section/title 43 | #: C/search.page:17 44 | msgid "Case sensitivity" 45 | msgstr "Osjetljivost na velika i mala slova" 46 | 47 | #. (itstool) path: section/p 48 | #: C/search.page:18 49 | msgid "" 50 | "The search is case sensitive when there is an uppercase letter. If the " 51 | "search terms are all in lowercase, the search is case insensitive. It's like " 52 | "the “smartcase” feature present in some text editors." 53 | msgstr "" 54 | "Pretraga je osjetljiva na mala i velika slova kada postoje velika slova. Ako " 55 | "izraz pretrage sadrži sva mala slova, pretraga je osjetljiva na velika i " 56 | "mala slova. To je poput \"pametne\" značajke prisutne u pojedinim " 57 | "uređivačima teksta." 58 | 59 | #. (itstool) path: section/title 60 | #: C/search.page:26 61 | msgid "Glob-style pattern matching" 62 | msgstr "Podudaranje uzoraka prema globalnom izgledu" 63 | 64 | #. (itstool) path: section/p 65 | #: C/search.page:27 66 | msgid "" 67 | "A search term can be a pattern containing ‘*’ and ‘?’ wildcards. ‘*’ matches " 68 | "an arbitrary, possibly empty, string; and ‘?’ matches an arbitrary character." 69 | msgstr "" 70 | "Izraz pretrage može biti uzorak koji sadrži ‘*’ i ‘?’ zamjenske znakove. ‘*’ " 71 | "odgovara proizvoljnom, moguće praznom izrazu; a '?' odgovara proizvoljnom " 72 | "znaku." 73 | 74 | #. (itstool) path: section/title 75 | #: C/search.page:35 76 | msgid "Several search terms" 77 | msgstr "Nekoliko izraza pretrage" 78 | 79 | #. (itstool) path: section/p 80 | #: C/search.page:36 81 | msgid "" 82 | "You can search with several search terms (separated by spaces). A symbol " 83 | "will match only if all the search terms individually match (not " 84 | "necessarily in the same order of appearance)." 85 | msgstr "" 86 | "Možete pretraživati s nekoliko izraza pretrage (odvojenim zarezom). Simbol " 87 | "će se samo podudarati ako se svi izrazi pretrage pojedinačno " 88 | "podudaraju (ne nužno u istom redoslijedu pojavljivanja)." 89 | 90 | #. (itstool) path: section/p 91 | #: C/search.page:41 92 | msgid "" 93 | "Note that it is different than searching with the ‘*’ wildcard: with the ‘*’ " 94 | "wildcard it forces the keywords to be in the same order." 95 | msgstr "" 96 | "Zapamtite da je drugačije od pretraživanja sa ‘*’ zamjenskim znakom: ‘*’ " 97 | "zamjenski znak prisiljuje ključnu riječ da bude u istom redoslijedu." 98 | 99 | #. (itstool) path: section/p 100 | #: C/search.page:45 101 | msgid "" 102 | "For example when searching “gtk window application”, it " 103 | "matches both “gtk_window_get_application()” and " 104 | "“GtkApplicationWindow” (among other symbols)." 105 | msgstr "" 106 | "Na primjer pri pretraživanju “gtk window application”, " 107 | "podudara se oboje “gtk_window_get_application()” i " 108 | "“GtkApplicationWindow” (među ostalim simbolima)." 109 | 110 | #. (itstool) path: section/p 111 | #: C/search.page:50 112 | msgid "" 113 | "On the other hand, searching “gtk*window*application” will " 114 | "match “gtk_window_get_application()” but not " 115 | "“GtkApplicationWindow”." 116 | msgstr "" 117 | "U drugu ruku, pretraživanje “gtk*window*application” će se " 118 | "podudarati sa “gtk_window_get_application()” ali ne i sa " 119 | "“GtkApplicationWindow”." 120 | -------------------------------------------------------------------------------- /help/meson.build: -------------------------------------------------------------------------------- 1 | pages = [ 2 | 'index.page', 3 | 'search.page' 4 | ] 5 | 6 | GNOME.yelp( 7 | 'devhelp', 8 | sources : pages 9 | ) 10 | -------------------------------------------------------------------------------- /help/pl/pl.po: -------------------------------------------------------------------------------- 1 | # Polish translation for devhelp help. 2 | # Copyright © 2018 the devhelp authors. 3 | # This file is distributed under the same license as the devhelp help. 4 | # Piotr Drąg , 2018. 5 | # Aviary.pl , 2018. 6 | # 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: devhelp-help\n" 10 | "POT-Creation-Date: 2018-02-06 21:50+0000\n" 11 | "PO-Revision-Date: 2018-02-08 01:44+0100\n" 12 | "Last-Translator: Piotr Drąg \n" 13 | "Language-Team: Polish \n" 14 | "Language: pl\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " 19 | "|| n%100>=20) ? 1 : 2);\n" 20 | 21 | #. (itstool) path: page/title 22 | #: C/index.page:4 23 | msgid "Devhelp User Documentation" 24 | msgstr "Dokumentacja programu Devhelp" 25 | 26 | #. Put one translator per line, in the form NAME , YEAR1, YEAR2 27 | msgctxt "_" 28 | msgid "translator-credits" 29 | msgstr "" 30 | "Piotr Drąg , 2018\n" 31 | "Aviary.pl , 2018" 32 | 33 | #. (itstool) path: page/title 34 | #: C/search.page:10 35 | msgid "Search in the side panel" 36 | msgstr "Wyszukiwanie w bocznym panelu" 37 | 38 | #. (itstool) path: synopsis/p 39 | #: C/search.page:13 40 | msgid "How the search in the side panel works." 41 | msgstr "Jak działa wyszukiwanie w panelu bocznym." 42 | 43 | #. (itstool) path: section/title 44 | #: C/search.page:17 45 | msgid "Case sensitivity" 46 | msgstr "Rozróżnianie wielkości znaków" 47 | 48 | #. (itstool) path: section/p 49 | #: C/search.page:18 50 | msgid "" 51 | "The search is case sensitive when there is an uppercase letter. If the " 52 | "search terms are all in lowercase, the search is case insensitive. It's like " 53 | "the “smartcase” feature present in some text editors." 54 | msgstr "" 55 | "Wyszukiwanie rozróżnia wielkość znaków, kiedy zawarta jest wielka litera. " 56 | "Jeśli wszystkie terminy wyszukiwania są w małych znakach, to wyszukiwanie " 57 | "nie rozróżnia wielkości znaków. Jest to podobne do funkcji „inteligentna " 58 | "wielkość znaków” obecnej w niektórych edytorach tekstu." 59 | 60 | #. (itstool) path: section/title 61 | #: C/search.page:26 62 | msgid "Glob-style pattern matching" 63 | msgstr "Dopasowywanie wzorów" 64 | 65 | #. (itstool) path: section/p 66 | #: C/search.page:27 67 | msgid "" 68 | "A search term can be a pattern containing ‘*’ and ‘?’ wildcards. ‘*’ matches " 69 | "an arbitrary, possibly empty, string; and ‘?’ matches an arbitrary character." 70 | msgstr "" 71 | "Termin wyszukiwania może być wzorem zawierającym wieloznaczniki „*” i „?”. " 72 | "„*” dopasowuje dowolny, także pusty, ciąg, a  „?” dopasowuje dowolny znak." 73 | 74 | #. (itstool) path: section/title 75 | #: C/search.page:35 76 | msgid "Several search terms" 77 | msgstr "Kilka terminów wyszukiwania" 78 | 79 | #. (itstool) path: section/p 80 | #: C/search.page:36 81 | msgid "" 82 | "You can search with several search terms (separated by spaces). A symbol " 83 | "will match only if all the search terms individually match (not " 84 | "necessarily in the same order of appearance)." 85 | msgstr "" 86 | "Można wyszukiwać kilka terminów (oddzielonych spacjami). Symbol zostanie " 87 | "dopasowany tylko, jeśli wszystkie terminy wyszukiwania pasują " 88 | "indywidualnie (niekoniecznie w tej samej kolejności)." 89 | 90 | #. (itstool) path: section/p 91 | #: C/search.page:41 92 | msgid "" 93 | "Note that it is different than searching with the ‘*’ wildcard: with the ‘*’ " 94 | "wildcard it forces the keywords to be in the same order." 95 | msgstr "" 96 | "Zauważ, że to co innego niż wyszukiwanie za pomocą wieloznacznika „*”: " 97 | "wieloznacznik wymusza, aby słowa kluczowe były w tej samej kolejności." 98 | 99 | #. (itstool) path: section/p 100 | #: C/search.page:45 101 | msgid "" 102 | "For example when searching “gtk window application”, it " 103 | "matches both “gtk_window_get_application()” and " 104 | "“GtkApplicationWindow” (among other symbols)." 105 | msgstr "" 106 | "Na przykład podczas wyszukiwania „gtk window application” " 107 | "dopasowane zostaną „gtk_window_get_application()” " 108 | "i „GtkApplicationWindow” (oraz inne symbole)." 109 | 110 | #. (itstool) path: section/p 111 | #: C/search.page:50 112 | msgid "" 113 | "On the other hand, searching “gtk*window*application” will " 114 | "match “gtk_window_get_application()” but not " 115 | "“GtkApplicationWindow”." 116 | msgstr "" 117 | "Z drugiej strony, wyszukiwanie „gtk*window*application” " 118 | "dopasuje „gtk_window_get_application()”, ale nie " 119 | "„GtkApplicationWindow”." 120 | -------------------------------------------------------------------------------- /help/pt_BR/pt_BR.po: -------------------------------------------------------------------------------- 1 | # Brazilian Portuguese translation for devhelp. 2 | # Copyright (C) 2018 devhelp's COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the devhelp package. 4 | # Rafael Fontenelle , 2018. 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: devhelp master\n" 8 | "POT-Creation-Date: 2018-02-11 16:27+0000\n" 9 | "PO-Revision-Date: 2018-02-11 15:53-0200\n" 10 | "Last-Translator: Rafael Fontenelle \n" 11 | "Language-Team: Brazilian Portuguese \n" 12 | "Language: pt_BR\n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: 8bit\n" 16 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 17 | "X-Generator: Virtaal 1.0.0-beta1\n" 18 | 19 | #. (itstool) path: page/title 20 | #: C/index.page:4 21 | msgid "Devhelp User Documentation" 22 | msgstr "Documentação do usuário do Devhelp" 23 | 24 | #. Put one translator per line, in the form NAME , YEAR1, YEAR2 25 | msgctxt "_" 26 | msgid "translator-credits" 27 | msgstr "Rafael Fontenelle , 2018" 28 | 29 | #. (itstool) path: page/title 30 | #: C/search.page:10 31 | msgid "Search in the side panel" 32 | msgstr "Pesquisando no painel lateral" 33 | 34 | #. (itstool) path: synopsis/p 35 | #: C/search.page:13 36 | msgid "How the search in the side panel works." 37 | msgstr "Como a pesquisa no painel lateral funciona." 38 | 39 | #. (itstool) path: section/title 40 | #: C/search.page:17 41 | msgid "Case sensitivity" 42 | msgstr "Diferenciando maiúsculas de minúsculas" 43 | 44 | #. (itstool) path: section/p 45 | #: C/search.page:18 46 | msgid "" 47 | "The search is case sensitive when there is an uppercase letter. If the " 48 | "search terms are all in lowercase, the search is case insensitive. It's like " 49 | "the “smartcase” feature present in some text editors." 50 | msgstr "" 51 | "A pesquisa diferencia maiúsculas de minúsculas quando há uma letra " 52 | "maiúscula. Se os termos de pesquisa estiverem em letras minúsculas, a " 53 | "pesquisa não é insensível a maiúsculas e minúsculas. É como o recurso " 54 | "“smartcase” presente em alguns editores de texto." 55 | 56 | #. (itstool) path: section/title 57 | #: C/search.page:26 58 | msgid "Glob-style pattern matching" 59 | msgstr "Combinação de padrão de estilo glob" 60 | 61 | #. (itstool) path: section/p 62 | #: C/search.page:27 63 | msgid "" 64 | "A search term can be a pattern containing ‘*’ and ‘?’ wildcards. ‘*’ matches " 65 | "an arbitrary, possibly empty, string; and ‘?’ matches an arbitrary character." 66 | msgstr "" 67 | "Um termo de pesquisa pode ser um padrão contendo curingas “*” e “?”. “*” " 68 | "corresponde a uma string arbitrária, possivelmente vazia; e “?” corresponde " 69 | "a um caractere arbitrário." 70 | 71 | #. (itstool) path: section/title 72 | #: C/search.page:35 73 | msgid "Several search terms" 74 | msgstr "Vários termos de pesquisa" 75 | 76 | #. (itstool) path: section/p 77 | #: C/search.page:36 78 | msgid "" 79 | "You can search with several search terms (separated by spaces). A symbol " 80 | "will match only if all the search terms individually match (not " 81 | "necessarily in the same order of appearance)." 82 | msgstr "" 83 | "Você pode pesquisar com vários termos de pesquisa (separados por espaços). " 84 | "Um símbolo irá coincidir apenas se todos os termos de pesquisa " 85 | "coincidirem individualmente (não necessariamente na mesma ordem de " 86 | "aparência)." 87 | 88 | #. (itstool) path: section/p 89 | #: C/search.page:41 90 | msgid "" 91 | "Note that it is different than searching with the ‘*’ wildcard: with the ‘*’ " 92 | "wildcard it forces the keywords to be in the same order." 93 | msgstr "" 94 | "Observe que é diferente de pesquisar com o curinga “*”: com o curinga “*”, " 95 | "ele força as palavras-chave a estarem na mesma ordem." 96 | 97 | #. (itstool) path: section/p 98 | #: C/search.page:45 99 | msgid "" 100 | "For example when searching “gtk window application”, it " 101 | "matches both “gtk_window_get_application()” and " 102 | "“GtkApplicationWindow” (among other symbols)." 103 | msgstr "" 104 | "Por exemplo, ao pesquisar “gtk window application”, ele " 105 | "corresponde a “gtk_window_get_application()” e " 106 | "“GtkApplicationWindow” (entre outros símbolos)." 107 | 108 | #. (itstool) path: section/p 109 | #: C/search.page:50 110 | msgid "" 111 | "On the other hand, searching “gtk*window*application” will " 112 | "match “gtk_window_get_application()” but not " 113 | "“GtkApplicationWindow”." 114 | msgstr "" 115 | "Por outro lado, a pesquisa “gtk*window*application” combinará " 116 | "“gtk_window_get_application()” mas não " 117 | "“GtkApplicationWindow”." 118 | -------------------------------------------------------------------------------- /meson_options.txt: -------------------------------------------------------------------------------- 1 | option('flatpak_build', type : 'boolean', value : false, description : 'Flatpak build mode') 2 | option('snap_build', type : 'boolean', value : false, description : 'Snap build mode') 3 | option('gtk_doc', type : 'boolean', value : false, description : 'Build the API reference') 4 | -------------------------------------------------------------------------------- /meson_post_install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import subprocess 5 | import sys 6 | 7 | data_dir = sys.argv[1] 8 | 9 | if not os.environ.get('DESTDIR'): 10 | icon_dir = os.path.join(data_dir, 'icons', 'hicolor') 11 | print('Update icon cache...') 12 | subprocess.call(['gtk-update-icon-cache', '-f', '-t', icon_dir]) 13 | 14 | schema_dir = os.path.join(data_dir, 'glib-2.0', 'schemas') 15 | print('Compiling gsettings schemas...') 16 | subprocess.call(['glib-compile-schemas', schema_dir]) 17 | -------------------------------------------------------------------------------- /plugins/devhelp.el: -------------------------------------------------------------------------------- 1 | ;; Emacs integration by Richard Hult 2 | ;; 3 | 4 | (defun devhelp-word-at-point () 5 | "Searches for the current word in Devhelp" 6 | (interactive) 7 | (start-process-shell-command "devhelp" nil "devhelp" "-s" (current-word)) 8 | (set-process-query-on-exit-flag (get-process "devhelp") nil) 9 | ) 10 | (defun devhelp-assistant-word-at-point () 11 | "Searches for the current work in the Devhelp assistant" 12 | (interactive) 13 | (setq w (current-word)) 14 | (start-process-shell-command "devhelp" nil "devhelp" "-a" w) 15 | (set-process-query-on-exit-flag (get-process "devhelp") nil) 16 | ) 17 | 18 | (defvar devhelp-timer nil) 19 | (defun devhelp-disable-assistant () 20 | (message "Devhelp assistant disabled") 21 | (cancel-timer devhelp-timer) 22 | (setq devhelp-timer nil) 23 | ) 24 | (defun devhelp-enable-assistant () 25 | (message "Devhelp assistant enabled") 26 | (setq devhelp-timer (run-with-idle-timer 0.6 t 'devhelp-assistant-word-at-point)) 27 | ) 28 | (defun devhelp-toggle-automatic-assistant () 29 | "Toggles automatic Devhelp assistant on and off" 30 | (interactive) 31 | (if devhelp-timer (devhelp-disable-assistant) (devhelp-enable-assistant)) 32 | ) 33 | 34 | ;; Examples: 35 | ;; 36 | ;; Bind F7 to start devhelp and search for the word at the point. 37 | ;; (global-set-key [f7] 'devhelp-word-at-point) 38 | ;; 39 | ;; Bind F6 to enable the automatic assistant. 40 | ;; (global-set-key [f6] 'devhelp-toggle-automatic-assistant) 41 | ;; 42 | ;; Bind F6 to search with the assistant window. 43 | ;; (global-set-key [f6] 'devhelp-assistant-word-at-point) 44 | 45 | (provide 'devhelp) 46 | -------------------------------------------------------------------------------- /plugins/devhelp.vim: -------------------------------------------------------------------------------- 1 | " devhelp.vim: A Devhelp assistant and search plugin for VIM. 2 | " 3 | " Copyright (c) 2008 Jannis Pohlmann 4 | " 5 | " To enable devhelp search: 6 | " let g:devhelpSearch=1 7 | " 8 | " To enable devhelp assistant: 9 | " let g:devhelpAssistant=1 10 | " 11 | " To change the update delay (e.g. to 150ms): 12 | " set updatetime=150 13 | " 14 | " To change the search key (e.g. to F5): 15 | " let g:devhelpSearchKey = '' 16 | " 17 | " To change the length (e.g. to 5 characters) before a word becomes 18 | " relevant: 19 | " let g:devhelpWordLength = 5 20 | " 21 | " This program is free software; you can redistribute it and/or modify 22 | " it under the terms of the GNU General Public License as published by 23 | " the Free Software Foundation; either version 3 of the License, or 24 | " (at your option) any later version. 25 | " 26 | " This program is distributed in the hope that it will be useful, 27 | " but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 29 | " General Public License for more details. 30 | " 31 | " You should have received a copy of the GNU General Public License 32 | " along with this program; if not, see . 33 | 34 | " Devhelp plugin configuration. These variables may be set in .vimrc 35 | " to override the defaults 36 | if !exists ('g:devhelpSearchKey') 37 | let g:devhelpSearchKey = '' 38 | endif 39 | if !exists ('g:devhelpWordLength') 40 | let g:devhelpWordLength = 5 41 | endif 42 | 43 | " Variable for remembering the last assistant word 44 | let s:lastWord = '' 45 | 46 | function! GetCursorWord () 47 | " Try to get the word below the cursor 48 | let s:word = expand ('') 49 | 50 | " If that's empty, try to use the word before the cursor 51 | if empty (s:word) 52 | let s:before = getline ('.')[0 : getpos ('.')[2]-1] 53 | let s:start = match (s:before, '\(\w*\)$') 54 | let s:end = matchend (s:before, '\(\w*\)$') 55 | let s:word = s:before[s:start : s:end] 56 | end 57 | 58 | return s:word 59 | endfunction 60 | 61 | function! DevhelpUpdate (flag) 62 | try 63 | " Get word below or before cursor 64 | let s:word = GetCursorWord () 65 | 66 | if a:flag == 'a' 67 | " Update Devhelp assistant window 68 | if s:lastWord != s:word && strlen (s:word) > g:devhelpWordLength 69 | " Update Devhelp 70 | call system ('devhelp -a '.s:word.' &') 71 | 72 | " Remember the word for next time 73 | let s:lastWord = s:word 74 | end 75 | else 76 | " Update devhelp search window. Since the user intentionally 77 | " pressed the search key, the word is not checked for its 78 | " length or whether it's new 79 | call system ('devhelp -s '.s:word.' &') 80 | end 81 | catch 82 | endtry 83 | endfunction 84 | 85 | function! DevhelpUpdateI (flag) 86 | " Use normal update function 87 | call DevhelpUpdate (a:flag) 88 | 89 | if col ('.') == len (getline ('.')) 90 | " Start appening if the cursor at the end of the line 91 | startinsert! 92 | else 93 | " Otherwise move the cursor to the right and start inserting. 94 | " This is required because moves the cursor to the left 95 | let s:pos = getpos ('.') 96 | let s:pos[2] += 1 97 | call setpos ('.', s:pos) 98 | startinsert 99 | endif 100 | endfunction 101 | 102 | if exists ('g:devhelpSearch') && g:devhelpSearch 103 | " Update the main Devhelp window when the search key is pressed 104 | exec 'nmap '.g:devhelpSearchKey.' :call DevhelpUpdate("s")' 105 | exec 'imap '.g:devhelpSearchKey.' :call DevhelpUpdateI("s")' 106 | endif 107 | 108 | if exists ('g:devhelpAssistant') && g:devhelpAssistant 109 | " Update the assistant window if the user hasn't pressed a key for a 110 | " while. See :help updatetime for how to change this delay 111 | au! CursorHold * nested call DevhelpUpdate('a') 112 | au! CursorHoldI * nested call DevhelpUpdate('a') 113 | endif 114 | -------------------------------------------------------------------------------- /plugins/gedit-plugin/devhelp.plugin.desktop.in: -------------------------------------------------------------------------------- 1 | [Plugin] 2 | Loader=python3 3 | Module=devhelp 4 | IAge=3 5 | Name=Devhelp support 6 | Description=Makes F2 bring up Devhelp for the word at the cursor 7 | Authors=Richard Hult 8 | # Translators: Do NOT translate or transliterate this text (this is an icon file name)! 9 | Icon=org.gnome.Devhelp 10 | Copyright=Copyright © 2006 Richard Hult 11 | Website=https://wiki.gnome.org/Apps/Devhelp 12 | -------------------------------------------------------------------------------- /plugins/gedit-plugin/devhelp.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 py-indent-offset: 4 -*- 2 | # 3 | # Gedit devhelp plugin 4 | # 5 | # Copyright (C) 2006 Imendio AB 6 | # Copyright (C) 2011 Red Hat, Inc. 7 | # 8 | # Author: Richard Hult 9 | # Author: Dan Williams 10 | # 11 | # This program is free software; you can redistribute it and/or modify 12 | # it under the terms of the GNU General Public License as published by 13 | # the Free Software Foundation; either version 3 of the License, or 14 | # (at your option) any later version. 15 | # 16 | # This program is distributed in the hope that it will be useful, 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | # GNU General Public License for more details. 20 | # 21 | # You should have received a copy of the GNU General Public License 22 | # along with this program; if not, see . 23 | 24 | from gi.repository import GObject, Gio, Gtk, Gedit 25 | import os 26 | import gettext 27 | 28 | class DevhelpAppActivatable(GObject.Object, Gedit.AppActivatable): 29 | 30 | app = GObject.Property(type=Gedit.App) 31 | 32 | def __init__(self): 33 | GObject.Object.__init__(self) 34 | 35 | def do_activate(self): 36 | self.app.add_accelerator("F2", "win.devhelp", None) 37 | 38 | # Translate actions below, hardcoding domain here to avoid complications now 39 | _ = lambda s: gettext.dgettext('devhelp', s) 40 | 41 | self.menu_ext = self.extend_menu("tools-section") 42 | item = Gio.MenuItem.new(_("Show API Documentation"), "win.devhelp") 43 | self.menu_ext.prepend_menu_item(item) 44 | 45 | def do_deactivate(self): 46 | self.app.remove_accelerator("win.devhelp", None) 47 | self.menu_ext = None 48 | 49 | class DevhelpWindowActivatable(GObject.Object, Gedit.WindowActivatable): 50 | 51 | window = GObject.Property(type=Gedit.Window) 52 | 53 | def __init__(self): 54 | GObject.Object.__init__(self) 55 | 56 | def do_activate(self): 57 | action = Gio.SimpleAction(name="devhelp") 58 | action.connect('activate', lambda a, p: self.do_devhelp(self.window.get_active_document())) 59 | self.window.add_action(action) 60 | 61 | def do_deactivate(self): 62 | self.window.remove_action("devhelp") 63 | 64 | def do_update_state(self): 65 | self.window.lookup_action("devhelp").set_enabled(self.window.get_active_document() is not None) 66 | 67 | def _is_word_separator(self, c): 68 | return not (c.isalnum() or c == '_') 69 | 70 | def do_devhelp(self, document): 71 | # Get the word at the cursor 72 | start = document.get_iter_at_mark(document.get_insert()) 73 | end = start.copy() 74 | 75 | # If just after a word, move back into it 76 | c = start.get_char() 77 | if self._is_word_separator(c): 78 | start.backward_char() 79 | 80 | # Go backward 81 | while True: 82 | c = start.get_char() 83 | if not self._is_word_separator(c): 84 | if not start.backward_char(): 85 | break 86 | else: 87 | start.forward_char() 88 | break 89 | 90 | # Go forward 91 | while True: 92 | c = end.get_char() 93 | if not self._is_word_separator(c): 94 | if not end.forward_char(): 95 | break 96 | else: 97 | break 98 | 99 | if end.compare(start) > 0: 100 | text = document.get_text(start,end,False).strip() 101 | if text: 102 | # FIXME: We need a dbus interface for devhelp soon... 103 | os.spawnlp(os.P_NOWAIT, 'devhelp', 'devhelp', '-s', text) 104 | 105 | # ex:ts=4:et: 106 | -------------------------------------------------------------------------------- /plugins/gedit-plugin/meson.build: -------------------------------------------------------------------------------- 1 | gedit_plugin_dir = join_paths(get_option('prefix'), get_option('libdir'), 'gedit/plugins') 2 | 3 | install_data( 4 | 'devhelp.py', 5 | install_dir : gedit_plugin_dir 6 | ) 7 | 8 | plugin_info_file = 'devhelp.plugin' 9 | I18N.merge_file( 10 | plugin_info_file, 11 | type : 'desktop', 12 | input : plugin_info_file + '.desktop.in', 13 | output : plugin_info_file, 14 | po_dir : '../../po/', 15 | install : true, 16 | install_dir : gedit_plugin_dir 17 | ) 18 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | # please keep this list sorted alphabetically 2 | # 3 | am 4 | ar 5 | as 6 | ast 7 | az 8 | be 9 | be@latin 10 | bg 11 | bn 12 | bn_IN 13 | bs 14 | ca 15 | ca@valencia 16 | cs 17 | da 18 | de 19 | dz 20 | el 21 | en_CA 22 | en_GB 23 | en@shaw 24 | eo 25 | es 26 | et 27 | eu 28 | fa 29 | fi 30 | fr 31 | fur 32 | gl 33 | gu 34 | he 35 | hi 36 | hr 37 | hu 38 | hy 39 | id 40 | is 41 | it 42 | ja 43 | kk 44 | km 45 | kn 46 | ko 47 | lt 48 | lv 49 | mai 50 | mk 51 | ml 52 | ms 53 | nb 54 | ne 55 | nl 56 | nn 57 | oc 58 | or 59 | pa 60 | pl 61 | ps 62 | pt 63 | pt_BR 64 | ro 65 | ru 66 | rw 67 | si 68 | sk 69 | sl 70 | sq 71 | sr 72 | sr@latin 73 | sv 74 | ta 75 | te 76 | tg 77 | th 78 | tr 79 | ug 80 | uk 81 | vi 82 | zh_CN 83 | zh_HK 84 | zh_TW 85 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # List of source files containing translatable strings. 2 | # Please keep this file sorted alphabetically. 3 | data/io.github.jkozera.ZevDocs.appdata.xml.in 4 | data/io.github.jkozera.ZevDocs.desktop.in 5 | data/org.gnome.devhelp.gschema.xml 6 | data/org.gnome.libdevhelp.gschema.xml.in 7 | devhelp/dh-application-window.c 8 | devhelp/dh-assistant-view.c 9 | devhelp/dh-book.c 10 | devhelp/dh-book-list-builder.c 11 | devhelp/dh-book-list.c 12 | devhelp/dh-book-list-directory.c 13 | devhelp/dh-book-list-simple.c 14 | devhelp/dh-book-manager.c 15 | devhelp/dh-book-tree.c 16 | devhelp/dh-completion.c 17 | devhelp/dh-error.c 18 | devhelp/dh-init.c 19 | devhelp/dh-keyword-model.c 20 | devhelp/dh-link.c 21 | devhelp/dh-notebook.c 22 | devhelp/dh-parser.c 23 | devhelp/dh-profile-builder.c 24 | devhelp/dh-profile.c 25 | devhelp/dh-search-bar.c 26 | devhelp/dh-search-context.c 27 | devhelp/dh-settings-builder.c 28 | devhelp/dh-settings.c 29 | devhelp/dh-sidebar.c 30 | devhelp/dh-tab.c 31 | devhelp/dh-tab-label.c 32 | devhelp/dh-util-lib.c 33 | devhelp/dh-web-view.c 34 | plugins/gedit-plugin/devhelp.plugin.desktop.in 35 | plugins/gedit-plugin/devhelp.py 36 | src/dh-app.c 37 | src/dh-assistant.c 38 | src/dh-assistant.ui 39 | src/dh-main.c 40 | src/dh-preferences.c 41 | src/dh-preferences.ui 42 | src/dh-settings-app.c 43 | src/dh-util-app.c 44 | src/dh-window.c 45 | src/dh-window.ui 46 | src/help-overlay.ui 47 | src/menus.ui 48 | -------------------------------------------------------------------------------- /po/POTFILES.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmymay/zevdocs/453629be8c90a4e5f76694415752ba8d4a829124/po/POTFILES.skip -------------------------------------------------------------------------------- /po/meson.build: -------------------------------------------------------------------------------- 1 | I18N.gettext( 2 | GETTEXT_PACKAGE_NAME, 3 | preset : 'glib' 4 | ) 5 | -------------------------------------------------------------------------------- /snap/plugins/x-dep.yaml: -------------------------------------------------------------------------------- 1 | options: 2 | source: 3 | required: true 4 | source-type: 5 | source-tag: 6 | source-branch: 7 | -------------------------------------------------------------------------------- /snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: zevdocs 2 | base: core18 3 | version: "0.5.1" 4 | summary: ZevDocs documentation browser 5 | description: ZevDocs is a documentation browser based on Devhelp supporting Zeal/Dash docsets. 6 | grade: stable 7 | confinement: strict 8 | icon: data/icons/256x256/io.github.jkozera.ZevDocs.png 9 | plugs: 10 | gnome-3-28-1804: 11 | interface: content 12 | target: gnome-platform 13 | default-provider: gnome-3-28-1804:gnome-3-28-1804 14 | content: gnome-3-28-1804 15 | apps: 16 | zevdocs: 17 | command: desktop-launch snapcraft-preload zevdocs 18 | desktop: usr/share/applications/io.github.jkozera.ZevDocs.desktop 19 | plugs: [network, network-bind, opengl, x11, wayland, desktop, home, gnome-3-28-1804, browser-support] 20 | environment: 21 | LD_LIBRARY_PATH: $SNAP/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/:$LD_LIBRARY_PATH 22 | parts: 23 | build-deps: 24 | after: [desktop-gnome-platform] 25 | plugin: nil 26 | stage-packages: 27 | - gsettings-desktop-schemas-dev 28 | - gobject-introspection 29 | - libgirepository1.0-dev 30 | - libwebkit2gtk-4.0-dev 31 | - libjson-glib-dev 32 | - gir1.2-webkit2-4.0 33 | - gir1.2-json-1.0 34 | - libcairo2-dev 35 | - itstool 36 | - golang 37 | - libc6-dev 38 | - libstdc++-dev 39 | prime: [-*] 40 | snapcraft-preload: 41 | after: [build-deps] 42 | source: https://github.com/jkozera/snapcraft-preload.git 43 | plugin: cmake 44 | zevdocs: 45 | after: [build-deps] 46 | plugin: meson 47 | meson-parameters: [--prefix=/usr,-Dsnap_build=true] 48 | source: https://github.com/jkozera/zevdocs.git 49 | source-branch: master 50 | stage-packages: 51 | - gnome-themes-extra-data 52 | - arc-theme 53 | - libwebkit2gtk-4.0-37 54 | - libjson-glib-1.0-0 55 | - libc6 56 | override-build: | 57 | snapcraftctl build 58 | sed -i 's|Icon=io.github.jkozera.ZevDocs|Icon=\${SNAP}/meta/gui/icon.png|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/io.github.jkozera.ZevDocs.desktop 59 | glib-compile-schemas $SNAPCRAFT_PART_INSTALL/usr/share/glib-2.0/schemas/ 60 | zealcore: 61 | after: [build-deps] 62 | plugin: dep 63 | go-importpath: github.com/jkozera/zealcore 64 | go-packages: [github.com/jkozera/zealcore] 65 | source: https://github.com/jkozera/zealcore.git 66 | source-commit: efe1c8e5046aa9d2644cafcfcd708418136dc476 67 | override-build: | 68 | sed -i s,github.com/zealdocs,github.com/jkozera,g `find ../go/src -name *.go` 69 | snapcraftctl build 70 | mkdir -p $SNAPCRAFT_PART_INSTALL/app/bin && cp -a ../go/bin/zealcore $SNAPCRAFT_PART_INSTALL/app/bin 71 | prime: [app] 72 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -I$(top_srcdir) \ 3 | -DG_LOG_DOMAIN=\"zevdocs\" \ 4 | $(WARN_CFLAGS) 5 | 6 | AM_LDFLAGS = \ 7 | $(WARN_LDFLAGS) 8 | 9 | app_headers = \ 10 | dh-app.h \ 11 | dh-assistant.h \ 12 | dh-preferences.h \ 13 | dh-settings-app.h \ 14 | dh-tab.h \ 15 | dh-tab-label.h \ 16 | dh-util-app.h \ 17 | dh-web-view.h \ 18 | dh-window.h \ 19 | tepl-info-bar.h \ 20 | $(NULL) 21 | 22 | app_c_files = \ 23 | dh-app.c \ 24 | dh-assistant.c \ 25 | dh-main.c \ 26 | dh-preferences.c \ 27 | dh-settings-app.c \ 28 | dh-tab.c \ 29 | dh-tab-label.c \ 30 | dh-util-app.c \ 31 | dh-web-view.c \ 32 | dh-window.c \ 33 | tepl-info-bar.c \ 34 | $(NULL) 35 | 36 | app_built_sources = \ 37 | dh-resources.c \ 38 | $(NULL) 39 | 40 | BUILT_SOURCES = \ 41 | $(app_built_sources) \ 42 | $(NULL) 43 | 44 | # The application 45 | bin_PROGRAMS = zevdocs 46 | 47 | zevdocs_SOURCES = \ 48 | $(app_headers) \ 49 | $(app_c_files) \ 50 | $(NULL) 51 | 52 | # Do not distribute generated files. 53 | nodist_zevdocs_SOURCES = \ 54 | $(app_built_sources) 55 | 56 | zevdocs_CPPFLAGS = \ 57 | $(AM_CPPFLAGS) 58 | 59 | zevdocs_CFLAGS = \ 60 | $(ZEVDOCS_CFLAGS) 61 | 62 | zevdocs_LDADD = \ 63 | $(zevdocs_LIBS) \ 64 | $(LIBM) \ 65 | $(top_builddir)/devhelp/libdevhelp-3.la 66 | 67 | zevdocs_LDFLAGS = \ 68 | $(AM_LDFLAGS) 69 | 70 | resource_files = \ 71 | dh-assistant.ui \ 72 | dh-preferences.ui \ 73 | dh-window.ui \ 74 | help-overlay.ui \ 75 | menus.ui \ 76 | $(NULL) 77 | 78 | dh-resources.c: dh.gresource.xml $(resource_files) 79 | $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source --c-name dh $(srcdir)/dh.gresource.xml 80 | 81 | EXTRA_DIST = \ 82 | dh.gresource.xml \ 83 | $(resource_files) \ 84 | $(NULL) 85 | 86 | CLEANFILES = $(BUILT_SOURCES) 87 | 88 | -include $(top_srcdir)/git.mk 89 | -------------------------------------------------------------------------------- /src/dh-app.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2012 Aleksander Morgado 6 | * Copyright (C) 2017 Sébastien Wilmet 7 | * 8 | * Devhelp is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, 11 | * or (at your option) any later version. 12 | * 13 | * Devhelp is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with Devhelp. If not, see . 20 | */ 21 | #pragma once 22 | 23 | #include 24 | #include "dh-window.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define DH_TYPE_APP (dh_app_get_type ()) 29 | 30 | G_DECLARE_DERIVABLE_TYPE (DhApp, dh_app, DH, APP, GtkApplication) 31 | 32 | struct _DhAppClass { 33 | GtkApplicationClass parent_class; 34 | }; 35 | 36 | DhApp *dh_app_new (void); 37 | DhWindow *dh_app_get_active_main_window (DhApp *app, 38 | gboolean create_if_none); 39 | 40 | G_END_DECLS 41 | -------------------------------------------------------------------------------- /src/dh-assistant.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2008 Imendio AB 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #ifndef DH_ASSISTANT_H 22 | #define DH_ASSISTANT_H 23 | 24 | #include 25 | #include "dh-app.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define DH_TYPE_ASSISTANT (dh_assistant_get_type ()) 30 | #define DH_ASSISTANT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), DH_TYPE_ASSISTANT, DhAssistant)) 31 | #define DH_ASSISTANT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), DH_TYPE_ASSISTANT, DhAssistantClass)) 32 | #define DH_IS_ASSISTANT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), DH_TYPE_ASSISTANT)) 33 | #define DH_IS_ASSISTANT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), DH_TYPE_ASSISTANT)) 34 | #define DH_ASSISTANT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), DH_TYPE_ASSISTANT, DhAssistantClass)) 35 | 36 | typedef struct _DhAssistant DhAssistant; 37 | typedef struct _DhAssistantClass DhAssistantClass; 38 | 39 | struct _DhAssistant { 40 | GtkApplicationWindow parent_instance; 41 | }; 42 | 43 | struct _DhAssistantClass { 44 | GtkApplicationWindowClass parent_class; 45 | }; 46 | 47 | GType dh_assistant_get_type (void) G_GNUC_CONST; 48 | 49 | DhAssistant * dh_assistant_new (DhApp *application); 50 | 51 | gboolean dh_assistant_search (DhAssistant *assistant, 52 | const gchar *str); 53 | 54 | G_END_DECLS 55 | 56 | #endif /* DH_ASSISTANT_H */ 57 | -------------------------------------------------------------------------------- /src/dh-assistant.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | -------------------------------------------------------------------------------- /src/dh-main.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2001-2003 CodeFactory AB 6 | * Copyright (C) 2001-2008 Imendio AB 7 | * 8 | * Devhelp is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, 11 | * or (at your option) any later version. 12 | * 13 | * Devhelp is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with Devhelp. If not, see . 20 | */ 21 | 22 | #include "config.h" 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include "dh-app.h" 35 | #include "dh-settings-app.h" 36 | 37 | 38 | static void wait_for_core () 39 | { 40 | bool connected = FALSE; 41 | struct sockaddr_in addr; 42 | int sockfd; 43 | 44 | while (!connected) { 45 | sockfd = socket(AF_INET, SOCK_STREAM, 0); 46 | addr.sin_family = AF_INET; 47 | addr.sin_port = htons(12340); 48 | inet_aton("127.0.0.1", &addr.sin_addr.s_addr); 49 | 50 | if (connect(sockfd, &addr, sizeof(addr)) < 0) { 51 | printf("Waiting for zealcore...\n"); 52 | } else { 53 | connected = TRUE; 54 | } 55 | sleep(1); 56 | } 57 | } 58 | 59 | int 60 | main (int argc, char **argv) 61 | { 62 | g_autoptr(DhApp) application; 63 | gint status; 64 | int pid_status; 65 | pid_t zealcore_pid = fork(); 66 | 67 | if (zealcore_pid == 0) { 68 | char env[10000] = {0}; 69 | strcat(env, "/run/host/usr/share:"); 70 | strcat(env, getenv("HOME")); 71 | strcat(env, "/.local/share"); 72 | setenv("XDG_DATA_DIRS", env, 1); 73 | setenv("GIN_MODE", "release", 1); 74 | if (getenv("SNAP")) { 75 | char path[10000] = {0}; 76 | strcat(path, getenv("SNAP")); 77 | strcat(path, "/app/bin/zealcore"); 78 | execl(path, "zealcore", (char *) NULL); 79 | } else { 80 | execl("/app/bin/zealcore", "zealcore", (char *) NULL); 81 | } 82 | return 0; 83 | } 84 | 85 | wait_for_core(); 86 | 87 | setlocale (LC_ALL, ""); 88 | textdomain (GETTEXT_PACKAGE); 89 | 90 | dh_init (); 91 | 92 | application = dh_app_new (); 93 | status = g_application_run (G_APPLICATION (application), argc, argv); 94 | 95 | dh_finalize (); 96 | dh_settings_app_unref_singleton (); 97 | 98 | if (waitpid(zealcore_pid, &pid_status, WNOHANG) == 0) { 99 | kill(zealcore_pid, SIGTERM); 100 | } 101 | 102 | return status; 103 | } 104 | -------------------------------------------------------------------------------- /src/dh-preferences.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2004-2008 Imendio AB 6 | * Copyright (C) 2010 Lanedo GmbH 7 | * 8 | * Devhelp is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, 11 | * or (at your option) any later version. 12 | * 13 | * Devhelp is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with Devhelp. If not, see . 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define DH_TYPE_PREFERENCES (dh_preferences_get_type ()) 29 | 30 | G_DECLARE_DERIVABLE_TYPE (DhPreferences, dh_preferences, DH, PREFERENCES, GtkDialog) 31 | 32 | struct _DhPreferencesClass { 33 | GtkDialogClass parent_class; 34 | }; 35 | 36 | void dh_preferences_show_dialog (GtkWindow *parent); 37 | 38 | G_END_DECLS 39 | 40 | -------------------------------------------------------------------------------- /src/dh-settings-app.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2012 Thomas Bechtold 6 | * Copyright (C) 2017, 2018 Sébastien Wilmet 7 | * 8 | * Devhelp is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, 11 | * or (at your option) any later version. 12 | * 13 | * Devhelp is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with Devhelp. If not, see . 20 | */ 21 | 22 | #include "dh-settings-app.h" 23 | 24 | /* Devhelp GSettings schema IDs */ 25 | #define SETTINGS_SCHEMA_ID_WINDOW "io.github.jkozera.ZevDocs.state.main.window" 26 | #define SETTINGS_SCHEMA_ID_PANED "io.github.jkozera.ZevDocs.state.main.paned" 27 | #define SETTINGS_SCHEMA_ID_ASSISTANT "io.github.jkozera.ZevDocs.state.assistant.window" 28 | 29 | typedef struct { 30 | GSettings *settings_window; 31 | GSettings *settings_paned; 32 | GSettings *settings_assistant; 33 | } DhSettingsAppPrivate; 34 | 35 | /* DhSettingsApp is a singleton. */ 36 | static DhSettingsApp *singleton = NULL; 37 | 38 | G_DEFINE_TYPE_WITH_PRIVATE (DhSettingsApp, dh_settings_app, G_TYPE_OBJECT); 39 | 40 | static void 41 | dh_settings_app_dispose (GObject *object) 42 | { 43 | DhSettingsApp *self = DH_SETTINGS_APP (object); 44 | DhSettingsAppPrivate *priv = dh_settings_app_get_instance_private (self); 45 | 46 | g_clear_object (&priv->settings_window); 47 | g_clear_object (&priv->settings_paned); 48 | g_clear_object (&priv->settings_assistant); 49 | 50 | G_OBJECT_CLASS (dh_settings_app_parent_class)->dispose (object); 51 | } 52 | 53 | static void 54 | dh_settings_app_finalize (GObject *object) 55 | { 56 | if (singleton == DH_SETTINGS_APP (object)) 57 | singleton = NULL; 58 | 59 | G_OBJECT_CLASS (dh_settings_app_parent_class)->finalize (object); 60 | } 61 | 62 | static void 63 | dh_settings_app_class_init (DhSettingsAppClass *klass) 64 | { 65 | GObjectClass *object_class = G_OBJECT_CLASS (klass); 66 | 67 | object_class->dispose = dh_settings_app_dispose; 68 | object_class->finalize = dh_settings_app_finalize; 69 | } 70 | 71 | static void 72 | dh_settings_app_init (DhSettingsApp *self) 73 | { 74 | DhSettingsAppPrivate *priv = dh_settings_app_get_instance_private (self); 75 | priv = dh_settings_app_get_instance_private (self); 76 | 77 | priv->settings_window = g_settings_new (SETTINGS_SCHEMA_ID_WINDOW); 78 | priv->settings_paned = g_settings_new (SETTINGS_SCHEMA_ID_PANED); 79 | priv->settings_assistant = g_settings_new (SETTINGS_SCHEMA_ID_ASSISTANT); 80 | } 81 | 82 | DhSettingsApp * 83 | dh_settings_app_get_singleton (void) 84 | { 85 | if (singleton == NULL) 86 | singleton = g_object_new (DH_TYPE_SETTINGS_APP, NULL); 87 | 88 | return singleton; 89 | } 90 | 91 | void 92 | dh_settings_app_unref_singleton (void) 93 | { 94 | if (singleton != NULL) 95 | g_object_unref (singleton); 96 | 97 | /* singleton is not set to NULL here, it is set to NULL in 98 | * dh_settings_app_finalize() (i.e. when we are sure that the ref count 99 | * reaches 0). 100 | */ 101 | } 102 | 103 | GSettings * 104 | dh_settings_app_peek_window_settings (DhSettingsApp *self) 105 | { 106 | DhSettingsAppPrivate *priv = dh_settings_app_get_instance_private (self); 107 | 108 | g_return_val_if_fail (DH_IS_SETTINGS_APP (self), NULL); 109 | 110 | return priv->settings_window; 111 | } 112 | 113 | GSettings * 114 | dh_settings_app_peek_paned_settings (DhSettingsApp *self) 115 | { 116 | DhSettingsAppPrivate *priv = dh_settings_app_get_instance_private (self); 117 | 118 | g_return_val_if_fail (DH_IS_SETTINGS_APP (self), NULL); 119 | 120 | return priv->settings_paned; 121 | } 122 | 123 | GSettings * 124 | dh_settings_app_peek_assistant_settings (DhSettingsApp *self) 125 | { 126 | DhSettingsAppPrivate *priv = dh_settings_app_get_instance_private (self); 127 | 128 | g_return_val_if_fail (DH_IS_SETTINGS_APP (self), NULL); 129 | 130 | return priv->settings_assistant; 131 | } 132 | -------------------------------------------------------------------------------- /src/dh-settings-app.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2012 Thomas Bechtold 6 | * Copyright (C) 2017, 2018 Sébastien Wilmet 7 | * 8 | * Devhelp is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, 11 | * or (at your option) any later version. 12 | * 13 | * Devhelp is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with Devhelp. If not, see . 20 | */ 21 | 22 | #ifndef DH_SETTINGS_APP_H 23 | #define DH_SETTINGS_APP_H 24 | 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define DH_TYPE_SETTINGS_APP (dh_settings_app_get_type ()) 30 | G_DECLARE_DERIVABLE_TYPE (DhSettingsApp, dh_settings_app, DH, SETTINGS_APP, GObject) 31 | 32 | struct _DhSettingsAppClass { 33 | GObjectClass parent; 34 | }; 35 | 36 | DhSettingsApp *dh_settings_app_get_singleton (void); 37 | void dh_settings_app_unref_singleton (void); 38 | GSettings *dh_settings_app_peek_window_settings (DhSettingsApp *self); 39 | GSettings *dh_settings_app_peek_paned_settings (DhSettingsApp *self); 40 | GSettings *dh_settings_app_peek_assistant_settings (DhSettingsApp *self); 41 | 42 | G_END_DECLS 43 | 44 | #endif /* DH_SETTINGS_APP_H */ 45 | -------------------------------------------------------------------------------- /src/dh-util-app.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2001-2002 Mikael Hallendal 6 | * Copyright (C) 2004,2008 Imendio AB 7 | * Copyright (C) 2015, 2017 Sébastien Wilmet 8 | * 9 | * Devhelp is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, 12 | * or (at your option) any later version. 13 | * 14 | * Devhelp is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with Devhelp. If not, see . 21 | */ 22 | 23 | #ifndef DH_UTIL_APP_H 24 | #define DH_UTIL_APP_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | void dh_util_window_settings_save (GtkWindow *window, 31 | GSettings *settings); 32 | 33 | void dh_util_window_settings_restore (GtkWindow *gtk_window, 34 | GSettings *settings); 35 | 36 | G_END_DECLS 37 | 38 | #endif /* DH_UTIL_APP_H */ 39 | -------------------------------------------------------------------------------- /src/dh-window.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2002 CodeFactory AB 6 | * Copyright (C) 2001-2002 Mikael Hallendal 7 | * Copyright (C) 2005 Imendio AB 8 | * Copyright (C) 2017-2018 Sébastien Wilmet 9 | * 10 | * Devhelp is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published 12 | * by the Free Software Foundation, either version 3 of the License, 13 | * or (at your option) any later version. 14 | * 15 | * Devhelp is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with Devhelp. If not, see . 22 | */ 23 | 24 | #pragma once 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define DH_TYPE_WINDOW (dh_window_get_type ()) 31 | 32 | G_DECLARE_DERIVABLE_TYPE (DhWindow, dh_window, DH, WINDOW, GtkApplicationWindow) 33 | 34 | struct _DhWindowClass { 35 | GtkApplicationWindowClass parent_class; 36 | }; 37 | 38 | 39 | GtkWidget *dh_window_new (GtkApplication *application); 40 | void dh_window_search (DhWindow *window, 41 | const gchar *str); 42 | void dh_window_display_uri (DhWindow *window, 43 | const gchar *uri); 44 | 45 | G_END_DECLS 46 | 47 | -------------------------------------------------------------------------------- /src/dh.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | dh-assistant.ui 5 | dh-preferences.ui 6 | dh-window.ui 7 | 8 | 9 | help-overlay.ui 10 | menus.ui 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/menus.ui: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | New _Window 30 | app.new-window 31 | 32 |
33 |
34 | 35 | _Preferences 36 | app.preferences 37 | 38 |
39 |
40 | 41 | _Keyboard Shortcuts 42 | win.show-help-overlay 43 | 44 | 45 | _Help 46 | app.help 47 | 48 | 49 | _About 50 | app.about 51 | 52 | 53 | _Quit 54 | app.quit 55 | 56 |
57 |
58 |
59 | -------------------------------------------------------------------------------- /src/meson.build: -------------------------------------------------------------------------------- 1 | devhelp_app_sources = [ 2 | 'dh-app.c', 3 | 'dh-assistant.c', 4 | 'dh-main.c', 5 | 'dh-preferences.c', 6 | 'dh-settings-app.c', 7 | 'dh-util-app.c', 8 | 'dh-window.c' 9 | ] 10 | 11 | devhelp_app_sources += GNOME.compile_resources( 12 | 'dh-resources', 13 | 'dh.gresource.xml' 14 | ) 15 | 16 | executable( 17 | 'zevdocs', 18 | devhelp_app_sources, 19 | include_directories : [CONFIG_H_INCLUDE_DIR, ROOT_INCLUDE_DIR], 20 | dependencies : [DEVHELP_APP_DEPS, SHARED_LIBDEVHELP_DECLARED_DEP], 21 | install : true 22 | ) 23 | -------------------------------------------------------------------------------- /unit-tests/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = \ 2 | -I$(top_srcdir) \ 3 | -I$(top_builddir) \ 4 | $(WARN_CFLAGS) \ 5 | $(ZEVDOCS_CFLAGS) 6 | 7 | AM_LDFLAGS = $(WARN_LDFLAGS) 8 | 9 | LDADD = $(top_builddir)/devhelp/libdevhelp-core.la \ 10 | $(ZEVDOCS_LIBS) 11 | 12 | UNIT_TEST_PROGS = 13 | 14 | UNIT_TEST_PROGS += test-completion 15 | test_completion_SOURCES = test-completion.c 16 | 17 | UNIT_TEST_PROGS += test-link 18 | test_link_SOURCES = test-link.c 19 | 20 | UNIT_TEST_PROGS += test-search-context 21 | test_search_context_SOURCES = test-search-context.c 22 | 23 | UNIT_TEST_PROGS += test-util 24 | test_util_SOURCES = test-util.c 25 | 26 | noinst_PROGRAMS = $(UNIT_TEST_PROGS) 27 | TESTS = $(UNIT_TEST_PROGS) 28 | 29 | -include $(top_srcdir)/git.mk 30 | -------------------------------------------------------------------------------- /unit-tests/meson.build: -------------------------------------------------------------------------------- 1 | unit_tests = [ 2 | 'test-completion', 3 | 'test-link', 4 | 'test-search-context', 5 | 'test-util' 6 | ] 7 | 8 | foreach unit_test : unit_tests 9 | exe = executable( 10 | unit_test, 11 | unit_test + '.c', 12 | include_directories : ROOT_INCLUDE_DIR, 13 | dependencies : [LIBDEVHELP_DEPS, STATIC_LIBDEVHELP_DECLARED_DEP] 14 | ) 15 | 16 | test(unit_test, exe) 17 | endforeach 18 | -------------------------------------------------------------------------------- /unit-tests/test-link.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2017 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | #define DEVHELP_BOOK_BASE_PATH "/usr/share/gtk-doc/html/devhelp" 24 | 25 | static void 26 | check_belongs_to_page_book_link (DhLink *book_link) 27 | { 28 | g_assert (dh_link_belongs_to_page (book_link, "index")); 29 | g_assert (!dh_link_belongs_to_page (book_link, "Index")); 30 | g_assert (!dh_link_belongs_to_page (book_link, "")); 31 | g_assert (!dh_link_belongs_to_page (book_link, "kiwi")); 32 | } 33 | 34 | static void 35 | test_belongs_to_page (void) 36 | { 37 | DhLink *book_link; 38 | DhLink *link; 39 | 40 | /* index.html */ 41 | book_link = dh_link_new_book (DEVHELP_BOOK_BASE_PATH, 42 | "devhelp", 43 | "Devhelp Reference Manual", 44 | "index.html"); 45 | check_belongs_to_page_book_link (book_link); 46 | dh_link_unref (book_link); 47 | 48 | /* Empty relative_url */ 49 | book_link = dh_link_new_book (DEVHELP_BOOK_BASE_PATH, 50 | "devhelp", 51 | "Devhelp Reference Manual", 52 | ""); 53 | check_belongs_to_page_book_link (book_link); 54 | 55 | /* A function */ 56 | link = dh_link_new (DH_LINK_TYPE_FUNCTION, 57 | book_link, 58 | "dh_link_ref", 59 | "DhLink.html#dh-link-ref"); 60 | 61 | g_assert (dh_link_belongs_to_page (link, "DhLink")); 62 | g_assert (!dh_link_belongs_to_page (link, "dhlink")); 63 | g_assert (!dh_link_belongs_to_page (link, "")); 64 | g_assert (!dh_link_belongs_to_page (link, "kiwi")); 65 | 66 | dh_link_unref (book_link); 67 | dh_link_unref (link); 68 | } 69 | 70 | int 71 | main (int argc, 72 | char **argv) 73 | { 74 | g_test_init (&argc, &argv, NULL); 75 | 76 | g_test_add_func ("/link/belongs_to_page", test_belongs_to_page); 77 | 78 | return g_test_run (); 79 | } 80 | -------------------------------------------------------------------------------- /unit-tests/test-util.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 | /* 3 | * This file is part of Devhelp. 4 | * 5 | * Copyright (C) 2017 Sébastien Wilmet 6 | * 7 | * Devhelp is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, 10 | * or (at your option) any later version. 11 | * 12 | * Devhelp is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Devhelp. If not, see . 19 | */ 20 | 21 | #include "devhelp/dh-util-lib.h" 22 | 23 | static void 24 | check_get_possible_index_files (const gchar *book_directory_path, 25 | const gchar *book_basename) 26 | { 27 | GFile *book_directory; 28 | GSList *list; 29 | GSList *l; 30 | gint i; 31 | 32 | book_directory = g_file_new_for_path (book_directory_path); 33 | list = _dh_util_get_possible_index_files (book_directory); 34 | 35 | g_assert_cmpint (g_slist_length (list), ==, 4); 36 | 37 | for (l = list, i = 0; l != NULL; l = l->next, i++) { 38 | GFile *index_file = G_FILE (l->data); 39 | gchar *expected_basename; 40 | gchar *basename; 41 | gchar *expected_path; 42 | const gchar *path; 43 | 44 | switch (i) { 45 | case 0: 46 | expected_basename = g_strconcat (book_basename, ".devhelp2", NULL); 47 | break; 48 | 49 | case 1: 50 | expected_basename = g_strconcat (book_basename, ".devhelp2.gz", NULL); 51 | break; 52 | 53 | case 2: 54 | expected_basename = g_strconcat (book_basename, ".devhelp", NULL); 55 | break; 56 | 57 | case 3: 58 | expected_basename = g_strconcat (book_basename, ".devhelp.gz", NULL); 59 | break; 60 | 61 | default: 62 | g_assert_not_reached (); 63 | } 64 | 65 | basename = g_file_get_basename (index_file); 66 | g_assert_cmpstr (basename, ==, expected_basename); 67 | 68 | expected_path = g_build_filename (book_directory_path, expected_basename, NULL); 69 | path = g_file_peek_path (index_file); 70 | g_assert_cmpstr (path, ==, expected_path); 71 | 72 | g_free (expected_basename); 73 | g_free (basename); 74 | g_free (expected_path); 75 | } 76 | 77 | g_object_unref (book_directory); 78 | g_slist_free_full (list, g_object_unref); 79 | } 80 | 81 | static void 82 | test_get_possible_index_files (void) 83 | { 84 | check_get_possible_index_files ("/usr/share/gtk-doc/html/glib", "glib"); 85 | check_get_possible_index_files ("/usr/share/gtk-doc/html/glib/", "glib"); 86 | check_get_possible_index_files ("/usr/share/gtk-doc/html/gtk3", "gtk3"); 87 | check_get_possible_index_files ("/usr/share/gtk-doc/html/gtk3/", "gtk3"); 88 | } 89 | 90 | int 91 | main (int argc, 92 | char **argv) 93 | { 94 | g_test_init (&argc, &argv, NULL); 95 | 96 | g_test_add_func ("/util/get_possible_index_files", test_get_possible_index_files); 97 | 98 | return g_test_run (); 99 | } 100 | -------------------------------------------------------------------------------- /zevdocs.doap: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | zevdocs 9 | A developer tool for browsing and searching API documentation 10 | 11 | ZevDocs is a developer tool for browsing and searching API documentation. 12 | It provides an easy way to navigate through libraries and to search by 13 | function, struct, or macro. 14 | 15 | The documentation must be installed locally, so an internet connection is 16 | not needed to use ZevDocs. 17 | 18 | ZevDocs works natively with GTK-Doc, so the GTK+ and GNOME libraries are 19 | well supported. But other development platforms can be supported as well, 20 | as long as the API documentation is available in HTML and a *.devhelp2 21 | index file is generated. 22 | 23 | ZevDocs integrates with other applications such as Glade, Builder or 24 | Anjuta, and plugins are available for different text editors (gedit, Vim, 25 | Emacs, Geany, …). 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | C 34 | 35 | 36 | 37 | Jerzy Kozera 38 | 39 | 40 | 41 | 42 | --------------------------------------------------------------------------------