mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-24 12:41:16 +00:00
gtk-demo: Turn world map path into a resource
The C string literal way way too long for MSVC. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
This commit is contained in:
parent
cc93347fe6
commit
122176a3a1
@ -424,7 +424,7 @@
|
||||
</gresource>
|
||||
<gresource prefix="/path_walk">
|
||||
<file>path_walk.ui</file>
|
||||
<file>path_world.c</file>
|
||||
<file compressed="true">path_world.txt</file>
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/Demo4">
|
||||
<file>icons/16x16/actions/application-exit.png</file>
|
||||
|
@ -9,8 +9,6 @@
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "path_world.c"
|
||||
|
||||
#define GTK_TYPE_PATH_WALK (gtk_path_walk_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (GtkPathWalk, gtk_path_walk, GTK, PATH_WALK, GtkWidget)
|
||||
|
||||
@ -179,7 +177,12 @@ gtk_path_walk_class_init (GtkPathWalkClass *klass)
|
||||
static void
|
||||
gtk_path_walk_init (GtkPathWalk *self)
|
||||
{
|
||||
GskPath *path = gsk_path_parse (path_world);
|
||||
/* Data taken from
|
||||
* https://commons.wikimedia.org/wiki/Maps_of_the_world#/media/File:Simplified_blank_world_map_without_Antartica_(no_borders).svg
|
||||
*/
|
||||
GBytes *data = g_resources_lookup_data ("/path_walk/path_world.txt", 0, NULL);
|
||||
GskPath *path = gsk_path_parse (g_bytes_get_data (data, NULL));
|
||||
g_bytes_unref (data);
|
||||
gtk_path_walk_set_path (self, path);
|
||||
gsk_path_unref (path);
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
1
demos/gtk-demo/path_world.txt
Normal file
1
demos/gtk-demo/path_world.txt
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user