Permalink
Browse files

Linux: Use the GtkWebkit library

  • Loading branch information...
1 parent b3c4ffd commit 3eabdfad0667d728a953f42860293ddf0b831c5b @andoma committed Jan 6, 2013
Showing with 59 additions and 20 deletions.
  1. +7 −2 configure.linux
  2. +1 −1 debian/control
  3. +2 −0 src/arch/arch.h
  4. +21 −10 src/arch/linux/linux_main.c
  5. +1 −1 src/showtime.c
  6. +2 −5 src/ui/glw/glw_x11.c
  7. +25 −1 src/ui/gu/gu.c
View
@@ -391,12 +391,12 @@ if enabled gu; then
if pkg-config gtk+-2.0 && pkg-config gthread-2.0; then
if disabled libx11; then
- echo "GLW depends on libx11"
+ echo "GU depends on libx11"
die
fi
if disabled libxext; then
- echo "GLW depends on libxext"
+ echo "GU depends on libxext"
die
fi
@@ -408,6 +408,11 @@ if enabled gu; then
echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs gthread-2.0`
echo >>${CONFIG_MAK} "CFLAGS_GTK += " `pkg-config --cflags gthread-2.0`
echo "Using GTK Threading: `pkg-config --modversion gthread-2.0`"
+
+ echo >>${CONFIG_MAK} "LDFLAGS_cfg += " `pkg-config --libs webkit-1.0`
+ echo >>${CONFIG_MAK} "CFLAGS_GTK += " `pkg-config --cflags webkit-1.0`
+ echo "Using WebKit: `pkg-config --modversion webkit-1.0`"
+
else
echo "GTK2 not found. Unable to build GU (GTK user interface)."
echo "To compile without it, configure with: --disable-gu"
View
@@ -2,7 +2,7 @@ Source: showtime
Section: main
Priority: extra
Maintainer: Andreas Öman <andreas@lonelycoder.com>
-Build-Depends: debhelper (>= 7.0.50), pkg-config, libfreetype6-dev, libfontconfig1-dev, libx11-dev, libxext-dev, libgl1-mesa-dev, libasound-dev, libpulse-dev, libgtk2.0-dev, libxss-dev, libxxf86vm-dev, libxv-dev, libcdio-cdda-dev, libssl-dev, libvdpau-dev, libgme-dev, libsidplay2-dev, libresid-builder-dev, yasm, curl, libsqlite3-dev
+Build-Depends: debhelper (>= 7.0.50), pkg-config, libfreetype6-dev, libfontconfig1-dev, libx11-dev, libxext-dev, libgl1-mesa-dev, libasound-dev, libpulse-dev, libgtk2.0-dev, libxss-dev, libxxf86vm-dev, libxv-dev, libcdio-cdda-dev, libssl-dev, libvdpau-dev, libgme-dev, libsidplay2-dev, libresid-builder-dev, yasm, curl, libsqlite3-dev, libwebkitgtk-dev
Package: showtime
Section: main
View
@@ -27,3 +27,5 @@ void arch_exit(void) __attribute__((noreturn));
int64_t arch_cache_avail_bytes(void);
int arch_pipe(int pipefd[2]);
+
+void arch_stop_req(void);
@@ -106,6 +106,20 @@ static GSourceFuncs source_funcs = {
};
+static int linux_run = 1;
+
+/**
+ *
+ */
+void
+arch_stop_req(void)
+{
+ linux_run = 0;
+ g_main_context_wakeup(g_main_context_default());
+}
+
+extern void gu_start(void);
+
/**
* Linux main
*/
@@ -136,18 +150,15 @@ main(int argc, char **argv)
g_source_attach(g_source_new(&source_funcs, sizeof(GSource)),
g_main_context_default());
+ g_source_attach(g_source_new(&source_funcs, sizeof(GSource)),
+ g_main_context_default());
+
linux_init_monitors();
-#if ENABLE_GU
- if(gconf.ui && !strcmp(gconf.ui, "gu")) {
- extern void gu_start(void);
- gu_start();
- } else
-#endif
- {
- extern void glw_x11_start(void);
- glw_x11_start();
- }
+ gu_start();
+
+ while(linux_run)
+ gtk_main_iteration();
showtime_fini();
View
@@ -556,7 +556,7 @@ showtime_shutdown(int retcode)
htsmsg_store_flush();
- event_to_ui(event_create_type(EVENT_STOP_UI));
+ arch_stop_req();
}
@@ -93,7 +93,6 @@ typedef struct glw_x11 {
Status status;
int working_vsync;
- int force_no_vsync;
struct x11_screensaver_state *sss;
@@ -345,7 +344,7 @@ window_open(glw_x11_t *gx11, int fullscreen)
glw_opengl_init_context(&gx11->gr);
- if(gx11->glXSwapIntervalSGI != NULL && gx11->force_no_vsync ==0)
+ if(gx11->glXSwapIntervalSGI != NULL)
gx11->glXSwapIntervalSGI(1);
gx11->working_vsync = check_vsync(gx11);
@@ -1262,9 +1261,7 @@ glw_x11_start(void)
gx11->displayname_real = getenv("DISPLAY");
// This may aid some vsync problems with nVidia drivers
- if(!gx11->force_no_vsync)
- setenv("__GL_SYNC_TO_VBLANK", "1", 1);
-
+ setenv("__GL_SYNC_TO_VBLANK", "1", 1);
if(glw_x11_init(gx11))
return 1;
View
@@ -326,6 +326,31 @@ gu_tab_create(gu_window_t *gw, int select)
return gt;
}
+#if 0
+
+#include <webkit/webkit.h>
+
+static void
+webkit_test(void)
+{
+/* Create the widgets */
+GtkWidget *main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+GtkWidget *scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+GtkWidget *web_view = webkit_web_view_new ();
+
+/* Place the WebKitWebView in the GtkScrolledWindow */
+gtk_container_add (GTK_CONTAINER (scrolled_window), web_view);
+gtk_container_add (GTK_CONTAINER (main_window), scrolled_window);
+
+/* Open a webpage */
+webkit_web_view_load_uri (WEBKIT_WEB_VIEW (web_view), "http://www.gnome.org");
+
+/* Show the result */
+gtk_window_set_default_size (GTK_WINDOW (main_window), 800, 600);
+gtk_widget_show_all (main_window);
+
+}
+#endif
/**
@@ -345,7 +370,6 @@ gu_start(void)
/* Init popup controller */
gu_popup_init(gu);
- gtk_main();
return 0;
}

0 comments on commit 3eabdfa

Please sign in to comment.