Commit a2b86b54 authored by Alessandro Bono's avatar Alessandro Bono Committed by Debarshi Ray
parent 9c4f35fb
......@@ -104,8 +104,7 @@ LIBGD_INIT([
gir
])
GJS_CONSOLE=`$PKG_CONFIG --variable=gjs_console gjs-1.0`
AC_SUBST(GJS_CONSOLE)
AC_PATH_PROG([GJS],[gjs])
GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
AC_SUBST(GLIB_COMPILE_RESOURCES)
......
SUBDIRS = icons
appdir = $(pkgdatadir)
app_resource_files = \
$(shell $(GLIB_COMPILE_RESOURCES) \
--sourcedir=$(srcdir) \
--generate-dependencies \
$(srcdir)/org.gnome.Documents.data.gresource.xml \
)
org.gnome.Documents.data.gresource: org.gnome.Documents.data.gresource.xml $(app_resource_files)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
--target=$@ \
--sourcedir=$(srcdir) $<
resourcedir = $(pkgdatadir)
resource_DATA = org.gnome.Documents.data.gresource
appdatadir = $(datadir)/appdata
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
appdata_in_files = \
......@@ -32,12 +48,22 @@ gsettings_SCHEMAS = org.gnome.documents.gschema.xml org.gnome.books.gschema.xml
EXTRA_DIST= \
$(appdata_in_files) \
$(app_resource_files) \
$(desktop_in_files) \
$(searchprovider_DATA) \
$(gsettings_SCHEMAS)
$(gsettings_SCHEMAS) \
org.gnome.Documents.data.gresource.xml
CLEANFILES = \
org.gnome.Documents.data.gresource \
$(appdata_DATA) \
$(desktop_DATA)
install-exec-hook:
-rm -f $(appdir)/org.gnome.Books.data.gresource
$(LN_S) $(appdir)/org.gnome.Documents.data.gresource $(DESTDIR)$(appdir)/org.gnome.Books.data.gresource
uninstall-hook:
-rm -f $(appdir)/org.gnome.Books.data.gresource
-include $(top_srcdir)/git.mk
......@@ -43,7 +43,7 @@ GdMainIconView.content-view.cell:active {
}
.documents-counter {
background-image: url("dnd-counter.svg");
background-image: url("ui/dnd-counter.svg");
background-size: contain;
background-color: transparent;
color: @theme_base_color;
......@@ -89,7 +89,7 @@ GdMainIconView.content-view.cell:active {
.content-view.document-page {
border-style: solid;
border-width: 3px 3px 6px 4px;
border-image: url("thumbnail-frame.png") 3 3 6 4;
border-image: url("ui/thumbnail-frame.png") 3 3 6 4;
}
.osd .page-thumbnail {
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/Documents">
<file>application.css</file>
<file preprocess="xml-stripblanks">ui/app-menu.ui</file>
<file preprocess="xml-stripblanks">ui/preview-context-menu.ui</file>
<file preprocess="xml-stripblanks">ui/preview-menu.ui</file>
<file preprocess="xml-stripblanks">ui/selection-menu.ui</file>
<file alias="ui/collections-placeholder.png" preprocess="to-pixdata">media/collections-placeholder.png</file>
<file alias="ui/dnd-counter.svg" preprocess="to-pixdata">media/dnd-counter.svg</file>
<file alias="ui/thumbnail-frame.png" preprocess="to-pixdata">media/thumbnail-frame.png</file>
</gresource>
</gresources>
......@@ -5,6 +5,10 @@ data/org.gnome.books.gschema.xml
data/org.gnome.Documents.appdata.xml.in
data/org.gnome.Documents.desktop.in
data/org.gnome.documents.gschema.xml
[type: gettext/glade]data/ui/app-menu.ui
[type: gettext/glade]data/ui/preview-context-menu.ui
[type: gettext/glade]data/ui/preview-menu.ui
[type: gettext/glade]data/ui/selection-menu.ui
src/application.js
src/documents.js
src/edit.js
......@@ -22,10 +26,6 @@ src/places.js
src/presentation.js
src/preview.js
src/properties.js
[type: gettext/glade]src/resources/app-menu.ui
[type: gettext/glade]src/resources/preview-context-menu.ui
[type: gettext/glade]src/resources/preview-menu.ui
[type: gettext/glade]src/resources/selection-menu.ui
src/searchbar.js
src/search.js
src/selections.js
......
jsdir = $(pkgdatadir)/js/
dist_js_DATA = \
application.js \
changeMonitor.js \
documents.js \
edit.js \
embed.js \
errorBox.js \
main.js \
mainBooks.js \
mainToolbar.js \
mainWindow.js \
manager.js \
miners.js \
notifications.js \
password.js \
places.js \
presentation.js \
preview.js \
properties.js\
query.js \
search.js \
searchbar.js \
selections.js \
sharing.js \
shellSearchProvider.js \
trackerController.js \
trackerUtils.js \
utils.js \
view.js \
windowMode.js \
path.js
BUILT_SOURCES += \
path.js \
config.js
......@@ -40,10 +7,6 @@ path.js: Makefile path.js.in
config.js: Makefile config.js.in
$(AM_V_GEN) $(do_subst) $(srcdir)/config.js.in > $@
nodist_js_DATA = \
path.js \
config.js
CLEANFILES += \
$(BUILT_SOURCES)
......
......@@ -11,6 +11,9 @@ AM_CPPFLAGS = \
girdir = $(pkgdatadir)/gir-1.0
typelibdir = $(pkglibdir)/girepository-1.0
appdir = $(pkgdatadir)
nodist_app_SCRIPTS = org.gnome.Documents org.gnome.Books
BUILT_SOURCES =
EXTRA_DIST =
CLEANFILES =
......@@ -18,7 +21,6 @@ pkglib_LTLIBRARIES =
INTROSPECTION_GIRS =
gir_DATA =
typelib_DATA =
bin_SCRIPTS =
libexec_PROGRAMS =
libexec_SCRIPTS =
......@@ -32,24 +34,48 @@ do_subst = sed -e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
-e 's|@libexecdir[@]|$(libexecdir)|g' \
-e 's|@pkglibdir[@]|$(pkglibdir)|g' \
-e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
-e 's|@GJS_CONSOLE[@]|$(GJS_CONSOLE)|g' \
-e 's|@GJS[@]|$(GJS)|g' \
-e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
-e 's|@PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
-e 's|@GETTEXT_PACKAGE[@]|$(GETTEXT_PACKAGE)|g'
-e 's|@GETTEXT_PACKAGE[@]|$(GETTEXT_PACKAGE)|g' \
-e 's|@prefix[@]|$(prefix)|g'
include $(INTROSPECTION_MAKEFILE)
include Makefile-lib.am
include Makefile-js.am
resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/gnome-documents.gresource.xml)
gnome-documents.gresource: gnome-documents.gresource.xml $(resource_files)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) $<
EXTRA_DIST += gnome-documents.gresource.xml $(resource_files)
documents_app_resource_files = \
$(shell $(GLIB_COMPILE_RESOURCES) \
--sourcedir=$(srcdir) \
--generate-dependencies \
$(srcdir)/org.gnome.Documents.src.gresource.xml \
)
org.gnome.Documents.src.gresource: org.gnome.Documents.src.gresource.xml $(documents_app_resource_files)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
--target=$@ \
--sourcedir=$(srcdir) $<
books_app_resource_files = \
$(shell $(GLIB_COMPILE_RESOURCES) \
--sourcedir=$(srcdir) \
--generate-dependencies \
$(srcdir)/org.gnome.Books.src.gresource.xml \
)
org.gnome.Books.src.gresource: org.gnome.Books.src.gresource.xml $(books_app_resource_files)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) \
--target=$@ \
--sourcedir=$(srcdir) $<
resourcedir = $(pkgdatadir)
resource_DATA = gnome-documents.gresource
resource_DATA = org.gnome.Documents.src.gresource org.gnome.Books.src.gresource
CLEANFILES += gnome-documents.gresource
CLEANFILES += $(resource_DATA)
EXTRA_DIST += \
$(documents_app_resource_files) \
$(books_app_resource_files) \
org.gnome.Documents.src.gresource.xml \
org.gnome.Books.src.gresource.xml
gir_DATA += $(INTROSPECTION_GIRS)
typelib_DATA += $(gir_DATA:.gir=.typelib)
......@@ -69,20 +95,28 @@ org.gnome.Books.service: org.gnome.Books.service.in
CLEANFILES += $(service_DATA)
EXTRA_DIST += $(service_in_files)
bin_SCRIPTS += gnome-documents
gnome-documents: gnome-documents.in
org.gnome.Documents: org.gnome.Documents.in
$(AM_V_GEN) $(do_subst) $< > $@
chmod +x $@
CLEANFILES += gnome-documents
EXTRA_DIST += gnome-documents.in
CLEANFILES += org.gnome.Documents
EXTRA_DIST += org.gnome.Documents.in
bin_SCRIPTS += gnome-books
gnome-books: gnome-books.in
org.gnome.Books: org.gnome.Books.in
$(AM_V_GEN) $(do_subst) $< > $@
chmod +x $@
CLEANFILES += gnome-books
EXTRA_DIST += gnome-books.in
CLEANFILES += org.gnome.Books
EXTRA_DIST += org.gnome.Books.in
install-exec-hook:
$(MKDIR_P) $(DESTDIR)$(bindir)
-rm -f $(DESTDIR)$(bindir)/gnome-documents
-rm -f $(DESTDIR)$(bindir)/gnome-books
$(LN_S) $(appdir)/org.gnome.Documents $(DESTDIR)$(bindir)/gnome-documents
$(LN_S) $(appdir)/org.gnome.Books $(DESTDIR)$(bindir)/gnome-books
uninstall-hook:
-rm -f $(DESTDIR)$(bindir)/gnome-documents
-rm -f $(DESTDIR)$(bindir)/gnome-books
-include $(top_srcdir)/git.mk
......@@ -22,18 +22,8 @@
const Lang = imports.lang;
const Mainloop = imports.mainloop;
const Signals = imports.signals;
const Gettext = imports.gettext;
const _ = imports.gettext.gettext;
// Import versions go here
imports.gi.versions.GdPrivate = '1.0';
imports.gi.versions.Gd = '1.0';
imports.gi.versions.Tracker = '1.0';
imports.gi.versions.TrackerControl = '1.0';
imports.gi.versions.EvinceDocument = '3.0';
imports.gi.versions.Goa = '1.0';
imports.gi.versions.WebKit2 = '4.0';
const EvDoc = imports.gi.EvinceDocument;
const GdPrivate = imports.gi.GdPrivate;
const Gdk = imports.gi.Gdk;
......@@ -53,7 +43,6 @@ const MainToolbar = imports.mainToolbar;
const Manager = imports.manager;
const Miners = imports.miners;
const Notifications = imports.notifications;
const Path = imports.path;
const Properties = imports.properties;
const Query = imports.query;
const Search = imports.search;
......@@ -120,15 +109,11 @@ const Application = new Lang.Class({
this.isBooks = isBooks;
Gettext.bindtextdomain('gnome-documents', Path.LOCALE_DIR);
Gettext.textdomain('gnome-documents');
let appid;
if (!this.isBooks) {
GLib.set_prgname('gnome-documents');
GLib.set_application_name(_("Documents"));
appid = 'org.gnome.Documents';
} else {
GLib.set_prgname('gnome-books');
GLib.set_application_name(_("Books"));
appid = 'org.gnome.Books';
}
......@@ -147,7 +132,7 @@ const Application = new Lang.Class({
let languages = GLib.get_language_names();
let files = languages.map(
function(language) {
return Gio.File.new_for_path(Path.RESOURCE_DIR + '/getting-started/' + language +
return Gio.File.new_for_path(pkg.pkgdatadir + '/getting-started/' + language +
'/gnome-documents-getting-started.pdf');
});
......@@ -338,7 +323,7 @@ const Application = new Lang.Class({
_initAppMenu: function() {
let builder = new Gtk.Builder();
builder.add_from_resource('/org/gnome/documents/app-menu.ui');
builder.add_from_resource('/org/gnome/Documents/ui/app-menu.ui');
let menu = builder.get_object('app-menu');
this.set_app_menu(menu);
......@@ -473,7 +458,7 @@ const Application = new Lang.Class({
if (gtkSettings.gtk_theme_name == 'Adwaita') {
if (cssProvider == null) {
cssProvider = new Gtk.CssProvider();
let file = Gio.File.new_for_uri("resource:///org/gnome/documents/Adwaita.css");
let file = Gio.File.new_for_uri("resource:///org/gnome/Documents/application.css");
cssProvider.load_from_file(file);
}
......@@ -491,9 +476,6 @@ const Application = new Lang.Class({
EvDoc.init();
let resource = Gio.Resource.load(Path.RESOURCE_DIR + '/gnome-documents.gresource');
resource._register();
application = this;
if (!application.isBooks)
settings = new Gio.Settings({ schema_id: 'org.gnome.documents' });
......
......@@ -39,7 +39,6 @@ const Application = imports.application;
const ChangeMonitor = imports.changeMonitor;
const Manager = imports.manager;
const Notifications = imports.notifications;
const Path = imports.path;
const Query = imports.query;
const Search = imports.search;
const TrackerUtils = imports.trackerUtils;
......@@ -563,7 +562,7 @@ const DocCommon = new Lang.Class({
if (this._thumbPath) {
let [ slice, border ] = Utils.getThumbnailFrameBorder();
thumbnailedPixbuf = Gd.embed_image_in_frame(emblemedPixbuf,
'resource:///org/gnome/documents/thumbnail-frame.png',
'resource:///org/gnome/Documents/ui/thumbnail-frame.png',
slice, border);
} else {
thumbnailedPixbuf = emblemedPixbuf;
......
#!/bin/sh
export GJS_PATH="@pkgdatadir@/js${GJS_PATH:+:$GJS_PATH}"
export GI_TYPELIB_PATH="@pkglibdir@/girepository-1.0${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}"
export LD_LIBRARY_PATH="@pkglibdir@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
if test x"$GJS_DEBUG_OUTPUT" = x ; then
export GJS_DEBUG_OUTPUT=stderr
fi
if test x"$GJS_DEBUG_TOPICS" = x ; then
export GJS_DEBUG_TOPICS="JS ERROR;JS LOG"
fi
DEBUG_COMMAND=""
if test x"$DOCUMENTS_RUN_DEBUG" != x; then
DEBUG_COMMAND="gdb --args"
fi
exec $DEBUG_COMMAND @GJS_CONSOLE@ -I @pkgdatadir@/js -c "const Main = imports.mainBooks; Main.start();" "$@"
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/documents">
<file alias="Adwaita.css">resources/Adwaita.css</file>
<file alias="app-menu.ui" preprocess="xml-stripblanks">resources/app-menu.ui</file>
<file alias="dnd-counter.svg" preprocess="to-pixdata">resources/dnd-counter.svg</file>
<file alias="preview-menu.ui" preprocess="xml-stripblanks">resources/preview-menu.ui</file>
<file alias="selection-menu.ui" preprocess="xml-stripblanks">resources/selection-menu.ui</file>
<file alias="preview-context-menu.ui" preprocess="xml-stripblanks">resources/preview-context-menu.ui</file>
<file alias="collections-placeholder.png" preprocess="to-pixdata">resources/collections-placeholder.png</file>
<file alias="thumbnail-frame.png" preprocess="to-pixdata">resources/thumbnail-frame.png</file>
</gresource>
</gresources>
#!/bin/sh
export GJS_PATH="@pkgdatadir@/js${GJS_PATH:+:$GJS_PATH}"
export GI_TYPELIB_PATH="@pkglibdir@/girepository-1.0${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}"
export LD_LIBRARY_PATH="@pkglibdir@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
if test x"$GJS_DEBUG_OUTPUT" = x ; then
export GJS_DEBUG_OUTPUT=stderr
fi
if test x"$GJS_DEBUG_TOPICS" = x ; then
export GJS_DEBUG_TOPICS="JS ERROR;JS LOG"
fi
DEBUG_COMMAND=""
if test x"$DOCUMENTS_RUN_DEBUG" != x; then
DEBUG_COMMAND="gdb --args"
fi
exec $DEBUG_COMMAND @GJS_CONSOLE@ -I @pkgdatadir@/js -c "const Main = imports.main; Main.start();" "$@"
......@@ -19,13 +19,27 @@
*
*/
pkg.initGettext();
pkg.initFormat();
pkg.require({ 'EvinceDocument': '3.0',
'Gd': '1.0',
'GdPrivate': '1.0',
'Gio': '2.0',
'GLib': '2.0',
'Goa': '1.0',
'Gtk': '3.0',
'GObject': '2.0',
'Tracker': '1.0',
'TrackerControl': '1.0',
'WebKit2': '4.0' });
const Application = imports.application;
const GLib = imports.gi.GLib;
const System = imports.system;
function start() {
let application = new Application.Application(false);
function main(args) {
let application = new Application.Application(pkg.name == 'org.gnome.Books');
if (GLib.getenv('DOCUMENTS_PERSIST'))
application.hold();
return application.run([System.programInvocationName].concat(ARGV));
return application.run(args);
}
/*
* Copyright (c) 2011 Red Hat, Inc.
*
* Gnome Documents is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Gnome Documents is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with Gnome Documents; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author: Cosimo Cecchi <cosimoc@redhat.com>
*
*/
const Application = imports.application;
const GLib = imports.gi.GLib;
const System = imports.system;
function start() {
let application = new Application.Application(true);
if (GLib.getenv('DOCUMENTS_PERSIST'))
application.hold();
return application.run([System.programInvocationName].concat(ARGV));
}
......@@ -116,7 +116,7 @@ const OverviewToolbar = new Lang.Class({
this.parent();
let builder = new Gtk.Builder();
builder.add_from_resource('/org/gnome/documents/selection-menu.ui');
builder.add_from_resource('/org/gnome/Documents/ui/selection-menu.ui');
let selectionMenu = builder.get_object('selection-menu');
this._selectionMenu = new Gtk.MenuButton({ menu_model: selectionMenu });
this._selectionMenu.get_style_context().add_class('selection-menu');
......
#!@GJS@
imports.package.init({ name: "gnome-documents",
version: "@PACKAGE_VERSION@",
prefix: "@prefix@",
libdir: "@libdir@" });
imports.package.run(imports.main);
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/Books/js">
<file>application.js</file>
<file>changeMonitor.js</file>
<file>documents.js</file>
<file>edit.js</file>
<file>embed.js</file>
<file>errorBox.js</file>
<file>main.js</file>
<file>mainToolbar.js</file>
<file>mainWindow.js</file>
<file>manager.js</file>
<file>miners.js</file>
<file>notifications.js</file>
<file>password.js</file>
<file>places.js</file>
<file>presentation.js</file>
<file>preview.js</file>
<file>properties.js</file>
<file>query.js</file>
<file>searchbar.js</file>
<file>search.js</file>
<file>selections.js</file>
<file>sharing.js</file>
<file>shellSearchProvider.js</file>
<file>testentry.js</file>
<file>trackerController.js</file>
<file>trackerUtils.js</file>
<file>utils.js</file>
<file>view.js</file>
<file>windowMode.js</file>
</gresource>
</gresources>
#!@GJS@
imports.package.init({ name: "gnome-documents",
version: "@PACKAGE_VERSION@",
prefix: "@prefix@",
libdir: "@libdir@" });
imports.package.run(imports.main);
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/Documents/js">
<file>application.js</file>
<file>changeMonitor.js</file>
<file>documents.js</file>
<file>edit.js</file>
<file>embed.js</file>
<file>errorBox.js</file>
<file>main.js</file>
<file>mainToolbar.js</file>
<file>mainWindow.js</file>
<file>manager.js</file>
<file>miners.js</file>
<file>notifications.js</file>
<file>password.js</file>
<file>places.js</file>
<file>presentation.js</file>
<file>preview.js</file>
<file>properties.js</file>
<file>query.js</file>
<file>searchbar.js</file>
<file>search.js</file>
<file>selections.js</file>
<file>sharing.js</file>
<file>shellSearchProvider.js</file>
<file>testentry.js</file>
<file>trackerController.js</file>
<file>trackerUtils.js</file>
<file>utils.js</file>
<file>view.js</file>
<file>windowMode.js</file>
</gresource>
</gresources>
let LOCALE_DIR = "@localedir@";
let STYLE_DIR = "@pkgdatadir@/style/";
let ICONS_DIR = "@pkgdatadir@/icons/";
let RESOURCE_DIR = "@pkgdatadir@";
......@@ -367,7 +367,7 @@ const PreviewView = new Lang.Class({
_getPreviewContextMenu: function() {
let builder = new Gtk.Builder();
builder.add_from_resource('/org/gnome/documents/preview-context-menu.ui');
builder.add_from_resource('/org/gnome/Documents/ui/preview-context-menu.ui');
return builder.get_object('preview-context-menu');
},
......@@ -890,7 +890,7 @@ const PreviewToolbar = new Lang.Class({
_getPreviewMenu: function() {
let builder = new Gtk.Builder();
builder.add_from_resource('/org/gnome/documents/preview-menu.ui');
builder.add_from_resource('/org/gnome/Documents/ui/preview-menu.ui');
let menu = builder.get_object('preview-menu');
let doc = Application.documentManager.getActiveItem();
......
......@@ -456,7 +456,7 @@ const OrganizeCollectionView = new Lang.Class({
margin_top: 64 });
this.add_overlay(this._msgGrid);
this._icon = new Gtk.Image({ resource: '/org/gnome/documents/collections-placeholder.png' });
this._icon = new Gtk.Image({ resource: '/org/gnome/Documents/ui/collections-placeholder.png' });
this._msgGrid.add(this._icon);
this._label = new Gtk.Label({
......
......@@ -32,7 +32,6 @@ const Tracker = imports.gi.Tracker;
const Application = imports.application;
const Format = imports.format;
const Path = imports.path;
const Query = imports.query;
const Search = imports.search;
const TrackerUtils = imports.trackerUtils;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment