/* * gpe-mini-browser2 * - Basic web browser for GPE and small screen GTK devices based on WebKitGtk - * - This file contains the implementation of the minor utility functions * - Utility functions are recurring functions for common, small tasks * * Dedicated to my dear Nóra. * * Author: Philippe De Swert * * Copyright (C) 2008 Philippe De Swert * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ui-callbacks.h" const gchar *parse_url (const gchar * url) { const gchar *p; p = strchr (url, ':'); if (p) { return url; } else { p = g_strconcat ("http://", url, NULL); } return (p); } GtkWidget * add_close_button(void) { GtkWidget *close_tab_button; close_tab_button = gpe_button_new_from_stock (GTK_STOCK_CLOSE, GPE_BUTTON_TYPE_ICON); g_signal_connect (G_OBJECT (close_tab_button), "clicked", G_CALLBACK (close_tab_cb), NULL); return close_tab_button; }