removed unused packages

This commit is contained in:
Artem Anufrij 2017-07-31 23:49:48 +02:00
parent 713146cb1e
commit c6c23a6850
8 changed files with 34 additions and 39 deletions

View file

@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 2.8) cmake_minimum_required (VERSION 2.8)
cmake_policy (VERSION 2.8) cmake_policy (VERSION 2.8)
project(com.github.artemanufrij.webpin) project (com.github.artemanufrij.webpin)
include (GNUInstallDirs) include (GNUInstallDirs)
set (DATADIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}") set (DATADIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}")
set (PKGDATADIR "${DATADIR}/${CMAKE_PROJECT_NAME}") set (PKGDATADIR "${DATADIR}/${CMAKE_PROJECT_NAME}")
@ -11,21 +11,14 @@ add_definitions ("-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\"")
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
find_package(PkgConfig) find_package(PkgConfig)
pkg_check_modules(DEPS REQUIRED pkg_check_modules(DEPS REQUIRED
gobject-2.0 gtk+-3.0>=3.12
glib-2.0 granite
gio-2.0 webkit2gtk-4.0
gtk+-3.0>=3.12
gthread-2.0
granite
gee-0.8
webkit2gtk-4.0
libsoup-2.4
gdk-pixbuf-2.0
) )
# add_definitions (-w)
add_subdirectory(po)
add_definitions(${DEPS_CFLAGS}) add_definitions(${DEPS_CFLAGS})
link_libraries(${DEPS_LIBRARIES}) link_libraries(${DEPS_LIBRARIES})
@ -37,5 +30,6 @@ include(ValaVersion)
ensure_vala_version("0.26.0" MINIMUM) ensure_vala_version("0.26.0" MINIMUM)
add_subdirectory (src) add_subdirectory (src)
add_subdirectory (po)
add_subdirectory (data) add_subdirectory (data)
add_subdirectory (schemas) add_subdirectory (schemas)

View file

@ -54,7 +54,7 @@ namespace Webpin {
return; return;
} }
mainwindow = new MainWindow (); mainwindow = new MainWindow ();
mainwindow.set_application(this); mainwindow.set_application(this);
} }
} }

View file

@ -1,9 +1,9 @@
vala_precompile(VALA_C ${CMAKE_PROJECT_NAME} vala_precompile(VALA_C ${CMAKE_PROJECT_NAME}
Widgets/ApplicationIcon.vala Widgets/ApplicationIcon.vala
Widgets/ApplicationsView.vala Widgets/ApplicationsView.vala
Widgets/Assistant.vala
Application.vala Application.vala
MainWindow.vala MainWindow.vala
Assistant.vala
DesktopFile.vala DesktopFile.vala
InfoDialog.vala InfoDialog.vala
Settings.vala Settings.vala
@ -14,12 +14,7 @@ vala_precompile(VALA_C ${CMAKE_PROJECT_NAME}
PACKAGES PACKAGES
gtk+-3.0 gtk+-3.0
granite granite
gio-2.0
gee-0.8
posix
webkit2gtk-4.0 webkit2gtk-4.0
libsoup-2.4
gdk-pixbuf-2.0
OPTIONS OPTIONS
--vapidir=${CMAKE_SOURCE_DIR}/vapi --vapidir=${CMAKE_SOURCE_DIR}/vapi

View file

@ -43,7 +43,6 @@ namespace Webpin {
X-GNOME-FullName=webpin X-GNOME-FullName=webpin
WebpinThemeColor=none"""; WebpinThemeColor=none""";
private GLib.KeyFile file; private GLib.KeyFile file;
public string name { get; private set; } public string name { get; private set; }

View file

@ -35,7 +35,7 @@ namespace Webpin {
private Gtk.Button back_button; private Gtk.Button back_button;
private Gtk.Button add_button; private Gtk.Button add_button;
private WebbyAssistant assistant; private Assistant assistant;
private ApplicationsView apps_view; private ApplicationsView apps_view;
public MainWindow () { public MainWindow () {
@ -73,7 +73,7 @@ namespace Webpin {
}); });
apps_view = new ApplicationsView(); apps_view = new ApplicationsView();
assistant = new WebbyAssistant(); assistant = new Assistant();
stack = new Gtk.Stack (); stack = new Gtk.Stack ();
stack.set_transition_duration (500); stack.set_transition_duration (500);

View file

@ -149,17 +149,24 @@ namespace Webpin {
});*/ });*/
var snap = (Cairo.ImageSurface) yield app_view.get_snapshot (WebKit.SnapshotRegion.VISIBLE, uint8[] data = {0, 0, 0};
WebKit.SnapshotOptions.NONE, null); int snap_width = 0;
try {
var snap = (Cairo.ImageSurface) yield app_view.get_snapshot (WebKit.SnapshotRegion.VISIBLE, WebKit.SnapshotOptions.NONE, null);
// data ist in BGRA apparently (according to testing). Docs said ARGB, but that
// appears not to be the case
data = snap.get_data ();
snap_width = snap.get_width ();
} catch (Error e) {
warning (e.message);
}
// data ist in BGRA apparently (according to testing). Docs said ARGB, but that
// appears not to be the case
unowned uint8[] data = snap.get_data ();
uint8 r = data[2]; uint8 r = data[2];
uint8 g = data[1]; uint8 g = data[1];
uint8 b = data[0]; uint8 b = data[0];
for (var i = 4; i < snap.get_width () * 3 * 4; i += 4) { for (var i = 4; i < snap_width * 3 * 4; i += 4) {
r = (r + data[i + 2]) / 2; r = (r + data[i + 2]) / 2;
g = (g + data[i + 1]) / 2; g = (g + data[i + 1]) / 2;
b = (b + data[i + 0]) / 2; b = (b + data[i + 0]) / 2;

View file

@ -58,8 +58,8 @@ namespace Webpin {
Gtk.Settings.get_default ().set ("gtk-application-prefer-dark-theme", should_use_dark_theme (web_app.ui_color)); Gtk.Settings.get_default ().set ("gtk-application-prefer-dark-theme", should_use_dark_theme (web_app.ui_color));
} catch (GLib.Error err) { } catch (GLib.Error err) {
warning("Loading style failed"); warning("Loading style failed");
} }
} }
web_app.theme_color_changed.connect( (color)=> { web_app.theme_color_changed.connect( (color)=> {
try { try {
@ -77,8 +77,8 @@ namespace Webpin {
this.set_titlebar (headerbar); this.set_titlebar (headerbar);
var info = DesktopFile.get_app_by_url(webapp_uri); var info = DesktopFile.get_app_by_url(webapp_uri);
var width = info.get_string("WebbyWindowWidth"); var width = info.get_string("WebpinWindowWidth");
var height = info.get_string("WebbyWindowHeight"); var height = info.get_string("WebpinWindowHeight");
if(width !=null && height != null) if(width !=null && height != null)
set_default_size (int.parse(width), int.parse(height)); set_default_size (int.parse(width), int.parse(height));
@ -134,8 +134,8 @@ namespace Webpin {
public void update_window_state (int width, int height) { public void update_window_state (int width, int height) {
var file = web_app.get_desktop_file(); var file = web_app.get_desktop_file();
file.edit_propertie ("WebbyWindowWidth", width.to_string()); file.edit_propertie ("WebpinWindowWidth", width.to_string());
file.edit_propertie ("WebbyWindowHeight", height.to_string()); file.edit_propertie ("WebpinWindowHeight", height.to_string());
} }
public override bool key_press_event (Gdk.EventKey event) { public override bool key_press_event (Gdk.EventKey event) {
@ -155,7 +155,7 @@ namespace Webpin {
if (handled) if (handled)
return true; return true;
return (base.key_press_event != null) ? base.key_press_event (event) : true; return (base.key_press_event != null) ? base.key_press_event (event) : true;
} }
private bool should_use_dark_theme (string theme_color) { private bool should_use_dark_theme (string theme_color) {

View file

@ -27,7 +27,7 @@
*/ */
namespace Webpin { namespace Webpin {
public class WebbyAssistant : Gtk.Box { public class Assistant : Gtk.Box {
public enum assistant_mode { new_app, edit_app } public enum assistant_mode { new_app, edit_app }
@ -55,7 +55,7 @@ namespace Webpin {
private assistant_mode mode { get; set; default = assistant_mode.new_app; } private assistant_mode mode { get; set; default = assistant_mode.new_app; }
public WebbyAssistant () { public Assistant () {
GLib.Object (orientation: Gtk.Orientation.VERTICAL); GLib.Object (orientation: Gtk.Orientation.VERTICAL);
apps = DesktopFile.get_applications (); apps = DesktopFile.get_applications ();