tazweb diff src/main.c @ rev 66
Uniformize gchar* and small fix
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Apr 22 09:39:16 2011 +0200 (2011-04-22) |
parents | 0b5ed969f4f2 |
children | 72220b3cf20b |
line diff
1.1 --- a/src/main.c Fri Apr 22 09:23:50 2011 +0200 1.2 +++ b/src/main.c Fri Apr 22 09:39:16 2011 +0200 1.3 @@ -24,13 +24,14 @@ 1.4 static gdouble load_progress; 1.5 static guint status_context_id; 1.6 static gchar* main_title; 1.7 -static gchar *title; 1.8 +static gchar* title; 1.9 static gint progress; 1.10 +static gint loader_width; 1.11 const gchar* uri; 1.12 1.13 /* Create an icon */ 1.14 static GdkPixbuf* 1.15 -create_pixbuf (const gchar * image) 1.16 +create_pixbuf (const gchar* image) 1.17 { 1.18 GdkPixbuf *pixbuf; 1.19 pixbuf = gdk_pixbuf_new_from_file (image, NULL); 1.20 @@ -49,27 +50,27 @@ 1.21 static void 1.22 draw_loader () 1.23 { 1.24 - GdkGC *gc = gdk_gc_new (loader->window); 1.25 + GdkGC* gc = gdk_gc_new (loader->window); 1.26 GdkColor fg; 1.27 1.28 uri = webkit_web_view_get_uri (web_view); 1.29 - const gint width = progress * loader->allocation.width / 100; 1.30 + loader_width = progress * loader->allocation.width / 100; 1.31 1.32 gdk_color_parse (loader_color, &fg); 1.33 gdk_gc_set_rgb_fg_color (gc, &fg); 1.34 gdk_draw_rectangle (loader->window, 1.35 loader->style->bg_gc [GTK_WIDGET_STATE (loader)], 1.36 TRUE, 0, 0, loader->allocation.width, loader->allocation.height); 1.37 - gdk_draw_rectangle (loader->window, gc, TRUE, 0, 0, width, 1.38 + gdk_draw_rectangle (loader->window, gc, TRUE, 0, 0, loader_width, 1.39 loader->allocation.height); 1.40 g_object_unref (gc); 1.41 } 1.42 1.43 /* Loader progress */ 1.44 static gboolean 1.45 -expose_loader_cb (GtkWidget *area, GdkEventExpose *event, gpointer data) 1.46 +expose_loader_cb (GtkWidget *loader, GdkEventExpose *event, gpointer data) 1.47 { 1.48 - draw_loader(); 1.49 + draw_loader (); 1.50 return TRUE; 1.51 } 1.52 1.53 @@ -197,7 +198,7 @@ 1.54 gpointer user_data) 1.55 { 1.56 uri = webkit_download_get_uri (download); 1.57 - const gchar *buffer; 1.58 + const gchar* buffer; 1.59 asprintf (&buffer, "tazbox dl-out %s", uri); 1.60 system (buffer); 1.61 } 1.62 @@ -219,7 +220,7 @@ 1.63 static void 1.64 populate_menu_cb (WebKitWebView *web_view, GtkMenu *menu, gpointer data) 1.65 { 1.66 - GtkWidget *item; 1.67 + GtkWidget* item; 1.68 1.69 /* Separator */ 1.70 item = gtk_separator_menu_item_new ();