Commit 0ecfc2f8 authored by James Westman's avatar James Westman

champlain_renderer_set_data: use guint8, not gchar

This makes the function properly introspectable in languages like Vala,
since they no longer think the argument is a null-terminated string.

Fixes #42.
parent 9b086d8a
......@@ -3,6 +3,7 @@
[CCode (cprefix = "GtkChamplain", gir_namespace = "GtkChamplain", gir_version = "0.12", lower_case_cprefix = "gtk_champlain_")]
namespace GtkChamplain {
[CCode (cheader_filename = "champlain-gtk/champlain-gtk.h", type_id = "gtk_champlain_embed_get_type ()")]
[Version (since = "0.4")]
public class Embed : Gtk.Alignment, Atk.Implementor, Gtk.Buildable {
[CCode (has_construct_function = false, type = "GtkWidget*")]
public Embed ();
......
This diff is collapsed.
......@@ -46,7 +46,7 @@ enum
static void set_data (ChamplainRenderer *renderer,
const gchar *data,
const guint8 *data,
guint size);
static void render (ChamplainRenderer *renderer,
ChamplainTile *tile);
......@@ -180,7 +180,7 @@ champlain_error_tile_renderer_new (guint tile_size)
static void
set_data (ChamplainRenderer *renderer, const gchar *data, guint size)
set_data (ChamplainRenderer *renderer, const guint8 *data, guint size)
{
/* always render the error tile no matter what data is set */
}
......
......@@ -656,7 +656,7 @@ file_loaded_cb (GFile *file,
g_signal_connect (tile, "render-complete", G_CALLBACK (tile_rendered_cb), user_data);
champlain_renderer_set_data (renderer, contents, length);
champlain_renderer_set_data (renderer, (guint8*) contents, length);
g_free (contents);
champlain_renderer_render (renderer, tile);
}
......
......@@ -144,7 +144,7 @@ champlain_file_tile_source_load_map_data (ChamplainFileTileSource *self,
}
renderer = champlain_map_source_get_renderer (CHAMPLAIN_MAP_SOURCE (self));
champlain_renderer_set_data (renderer, data, length);
champlain_renderer_set_data (renderer, (guint8*) data, length);
g_free (data);
}
......
......@@ -50,7 +50,7 @@ struct _RendererData
};
static void set_data (ChamplainRenderer *renderer,
const gchar *data,
const guint8 *data,
guint size);
static void render (ChamplainRenderer *renderer,
ChamplainTile *tile);
......@@ -118,7 +118,7 @@ champlain_image_renderer_new (void)
static void
set_data (ChamplainRenderer *renderer, const gchar *data, guint size)
set_data (ChamplainRenderer *renderer, const guint8 *data, guint size)
{
ChamplainImageRendererPrivate *priv = GET_PRIVATE (renderer);
......
......@@ -358,7 +358,7 @@ fill_tile (ChamplainMapSource *map_source,
g_signal_connect (tile, "render-complete", G_CALLBACK (tile_rendered_cb), map_source);
champlain_renderer_set_data (renderer, member->data, member->size);
champlain_renderer_set_data (renderer, (guint8*) member->data, member->size);
champlain_renderer_render (renderer, tile);
return;
......
......@@ -339,7 +339,7 @@ load_map_data_cb (G_GNUC_UNUSED SoupSession *session, SoupMessage *msg,
g_object_set (G_OBJECT (self), "state", CHAMPLAIN_STATE_DONE, NULL);
renderer = champlain_map_source_get_renderer (CHAMPLAIN_MAP_SOURCE (self));
champlain_renderer_set_data (renderer, msg->response_body->data, msg->response_body->length);
champlain_renderer_set_data (renderer, (guint8*) msg->response_body->data, msg->response_body->length);
}
......
......@@ -765,7 +765,7 @@ tile_loaded_cb (G_GNUC_UNUSED SoupSession *session,
g_signal_connect (tile, "render-complete", G_CALLBACK (tile_rendered_cb), data);
champlain_renderer_set_data (renderer, msg->response_body->data, msg->response_body->length);
champlain_renderer_set_data (renderer, (guint8*) msg->response_body->data, msg->response_body->length);
champlain_renderer_render (renderer, tile);
return;
......
......@@ -58,7 +58,7 @@ champlain_renderer_class_init (ChamplainRendererClass *klass)
/**
* champlain_renderer_set_data:
* @renderer: a #ChamplainRenderer
* @data: data used for tile rendering
* @data: (array length=size): data used for tile rendering
* @size: size of the data in bytes
*
* Sets the data which is used to render tiles by the renderer.
......@@ -67,7 +67,7 @@ champlain_renderer_class_init (ChamplainRendererClass *klass)
*/
void
champlain_renderer_set_data (ChamplainRenderer *renderer,
const gchar *data,
const guint8 *data,
guint size)
{
g_return_if_fail (CHAMPLAIN_IS_RENDERER (renderer));
......
......@@ -66,7 +66,7 @@ struct _ChamplainRendererClass
GInitiallyUnownedClass parent_class;
void (*set_data)(ChamplainRenderer *renderer,
const gchar *data,
const guint8 *data,
guint size);
void (*render)(ChamplainRenderer *renderer,
ChamplainTile *tile);
......@@ -75,7 +75,7 @@ struct _ChamplainRendererClass
GType champlain_renderer_get_type (void);
void champlain_renderer_set_data (ChamplainRenderer *renderer,
const gchar *data,
const guint8 *data,
guint size);
void champlain_renderer_render (ChamplainRenderer *renderer,
ChamplainTile *tile);
......
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