diff options
| -rw-r--r-- | sb.c | 17 | 
1 files changed, 8 insertions, 9 deletions
| @@ -1,10 +1,3 @@ -/* Simple browser my attempt at an even less-sucking browser than surf. - * original code is from alot of places, gtkforums.com, gtkwebkit.org provided - * alot of nice API examples :), and of course, surf (though i was careful not  - *    to steal any code because of the damned MIT/X license) - * uzbl also helped inspire me. along with a previous surf fork named inferno. -*/ -  #include <gdk/gdkkeysyms.h>  #include <string.h>  #include <unistd.h> @@ -99,7 +92,10 @@ void load_uri(gchar *uri) {    gchar *u;    struct tab *t = get_tab(NULL, gtk_notebook_get_current_page(w.notebook)); -  /*Borrowed from surf, no point creating another method, this seems to work well */ +  /*Borrowed from surf, no point creating another method, this seems to work well +   * these few lines of code were distributed under the MIT/X license by the  +   * suckless project. */ +    u = g_strrstr(uri, "://") ? g_strdup(uri) : g_strdup_printf("http://%s", uri);    webkit_web_view_load_uri(t->view, u); @@ -303,12 +299,14 @@ void tab_focus(GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer    gtk_entry_set_text(GTK_ENTRY(w.bar), url);  } +  /* focus on  view */  void focus_view() {  	struct tab *t = get_tab(NULL, gtk_notebook_get_current_page(w.notebook));  	gtk_widget_grab_focus(GTK_WIDGET(t->view));	  } +  /* misc functions to help initialization */  void window_setup() { @@ -318,7 +316,7 @@ void window_setup() {    w.hbox = gtk_hbox_new(FALSE, 0);    w.notebook = gtk_notebook_new(); -  w.bar = gtk_entry_new (); +  w.bar = gtk_entry_new();    w.searchbar = gtk_entry_new();    w.status = gtk_statusbar_new(); @@ -358,6 +356,7 @@ void window_setup() {  } +  /* main function */  int main (int argc, char* argv[]) {    gtk_init (&argc, &argv); | 
