Commit 0e7d1531 authored by Moritz Sokoll's avatar Moritz Sokoll 💬
Browse files

added license, moved .h files to .hpp

parent a5ed3183
Pipeline #187 failed with stages
in 2 minutes and 51 seconds
......@@ -4,7 +4,6 @@ before_script:
- apt-get update
- apt-get install -y libwebkit2gtk-4.0-dev
- apt-get install -y libgtk-3-dev
- mkdir bin
cache:
paths:
......@@ -13,6 +12,7 @@ cache:
build:
stage: build
script:
- mkdir bin
- make
- make debug-build
artifacts:
......
This diff is collapsed.
# GWebB
## a WebKitGTK based web browser
GwebB is a web browser created to be simple, fast and feature rich
......@@ -2,7 +2,9 @@
#define GWEBB_TABS_H
#include <gtk/gtk.h>
#include <webkit2/webkit2.h>
int createTab(GtkNotebook *notebook, char* uri, char* title);
namespace libgweb {
int createTab(GtkNotebook *notebook, const char* uri, const char* title);
void changeTabTitle(GtkWidget *webview, gpointer data);
}
#endif
......@@ -3,8 +3,8 @@
#include <stdio.h>
#include <string.h>
#include <iostream>
#include "lib/values.h"
#include "lib/tabs.h"
#include "lib/values.hpp"
#include "lib/tabs.hpp"
using namespace std;
static void destroy( GtkWidget *widget, gpointer data) { gtk_main_quit(); }
......@@ -34,7 +34,7 @@ int main(int argc, char* argv[]) {
//create the notebook widget with one page
notebook = gtk_notebook_new();
int nbstat = createTab(GTK_NOTEBOOK(notebook), "https://google.de", "test sheesh");
int nbstat = libgweb::createTab(GTK_NOTEBOOK(notebook), "https://google.de", "test sheesh");
if (nbstat == -1) { printf("gtk notebook page appending failed"); return 1; }
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(destroy), NULL);
......
#include "lib/tabs.h"
#include "lib/tabs.hpp"
#include <gtk/gtk.h>
#include <webkit2/webkit2.h>
int createTab(GtkNotebook *notebook, char* uri, char* title) {
GtkWidget *webview = webkit_web_view_new();
int nbstat = gtk_notebook_append_page(GTK_NOTEBOOK(notebook), webview, gtk_label_new(title));
void libgweb::changeTabTitle(GtkWidget *webview, gpointer data) {
gtk_notebook_set_tab_label(GTK_NOTEBOOK(data),
webview,
gtk_label_new(webkit_web_view_get_title(WEBKIT_WEB_VIEW(webview)
)));
}
int libgweb::createTab(GtkNotebook *notebook, const char* uri, const char* title) {
//TODO: add all Widgets
GtkWidget *webview, *grid, *uribar;
webview = webkit_web_view_new();
uribar = gtk_entry_new();
//TODO: Implement grid for all widgets
grid = gtk_grid_new();
//append children
gtk_grid_attach(GTK_GRID(grid), uribar, 0, 0, 1, 1);
gtk_grid_attach(GTK_GRID(grid), webview, 0, 0, 1, 1);
gtk_grid_set_baseline_row(GTK_GRID(grid), 0);
webkit_web_view_load_uri(WEBKIT_WEB_VIEW(webview), uri);
gtk_widget_show(webview);
int nbstat = gtk_notebook_append_page(GTK_NOTEBOOK(notebook), grid, gtk_label_new(title));
g_signal_connect(G_OBJECT(webview), "notify::title", G_CALLBACK(changeTabTitle), (gpointer ) notebook);
gtk_widget_show(uribar);
//gtk_widget_show(webview);
gtk_widget_show(grid);
return nbstat;
}
#include "lib/values.h"
#include "lib/values.hpp"
const char* GWEBB_VERSION_STR = "0.0.1";
const char* GWEBB_HELP_STR = "Usage: gwebb [option] [url]\n"
"Options:\n"
......
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