Commit a7348d0e authored by Moritz Sokoll's avatar Moritz Sokoll 💬
Browse files

Inital Commit

parents
sessions
bin
all:
g++ `pkg-config --cflags --libs gtk+-3.0` `pkg-config --cflags --libs webkit2gtk-4.0` -fpermissive src/main.cpp src/values.cpp -o bin/gwebb
#ifndef GWEBB_TABS_H
#define GWEBB_TABS_H
#endif
#ifndef GWEBB_VALUES_H
#define GWEBB_VALUES_H
extern const char* GWEBB_VERSION_STR;
extern const char* GWEBB_HELP_STR;
#endif
#include <gtk/gtk.h>
#include <webkit2/webkit2.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include "lib/values.h"
using namespace std;
static void destroy( GtkWidget *widget, gpointer data) { gtk_main_quit(); }
int main(int argc, char* argv[]) {
GtkWidget* notebook, *window;
bool gui = true;
for (int i=0; i<argc; i++) {
string arg = argv[i];
if (arg == (string) "-v" || arg== (string) "--version") {
printf("%s\n", GWEBB_VERSION_STR);
gui = false;
}
else if (arg == (string) "-h" || arg == (string) "--help") {
printf("%s\n", GWEBB_HELP_STR);
gui = false;
}
}
if (!gui) {return 0;}
gtk_init(&argc, &argv);
notebook = gtk_notebook_new();
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(destroy), NULL);
//adding widgets to their parents if needed
gtk_container_add(GTK_CONTAINER(window), notebook);
//displaying the widgets
gtk_widget_show(window);
gtk_widget_show(notebook);
//running the gui application
gtk_main();
}
#include "lib/values.h"
const char* GWEBB_VERSION_STR = "0.0.1";
const char* GWEBB_HELP_STR = "Usage: gwebb [option] [url]\n"
"Options:\n"
"-v, --version: prints the version and exits\n"
"-h, --help: prints this help message\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