diff options
author | David Härdeman <david@hardeman.nu> | 2015-09-01 10:05:43 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2015-09-01 21:28:34 +0200 |
commit | 0a9be50b38fc44100d727a60ab487b46f44b605a (patch) | |
tree | ad0c6a000f9f15fd80b1f777bd252d1c25ed74a9 | |
parent | 6f51fdc108dd5251befb57e8df82ea723328ffed (diff) |
Implement basic gresource usage
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | rcm-client-main.c | 2 | ||||
-rw-r--r-- | rcm-client.gresource.xml | 6 |
4 files changed, 16 insertions, 3 deletions
@@ -3,3 +3,4 @@ rcm-server rcm-client *.swp generated.* +rcm-client-resources.* @@ -27,8 +27,8 @@ RCC_CFLAGS = ${GENERIC_CFLAGS} ${EXTRA_CFLAGS} $(shell pkg-config --cflags ${RCC RCC_LDFLAGS = ${GENERIC_LDFLAGS} ${EXTRA_LDFLAGS} $(shell pkg-config --libs ${RCC_PACKAGES}) RCC_COMPILE = $(CC) $(RCC_CFLAGS) RCC_LINK = $(CC) $(RCC_CFLAGS) $(RCC_LDFLAGS) -RCC_OBJECTS = rcm-client-main.o rcm-client-hardware-list.o rcm-client-receive.o rcm-client-advanced.o generated.o shared.o -RCC_HEADERS = rcm-client-main.h rcm-client-hardware-list.h rcm-client-receive.h rcm-client-advanced.h generated.h $(COMMON_HEADERS) +RCC_OBJECTS = rcm-client-main.o rcm-client-hardware-list.o rcm-client-receive.o rcm-client-advanced.o rcm-client-resources.o generated.o shared.o +RCC_HEADERS = rcm-client-main.h rcm-client-hardware-list.h rcm-client-receive.h rcm-client-advanced.h rcm-client-resources.h generated.h $(COMMON_HEADERS) INSTALL = install -c INSTALL_PROGRAM = ${INSTALL} @@ -54,6 +54,12 @@ shared.o: shared.c shared.h linux-input-keycodes.o: linux-input-keycodes.c $(COMMON_HEADERS) $(CC) $(GENERIC_CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $< +rcm-client-resources.c: rcm-client.gresource.xml $(shell glib-compile-resources --generate-dependencies rcm-client.gresource.xml) + glib-compile-resources --target=$@ --generate-source --c-name rcm rcm-client.gresource.xml + +rcm-client-resources.h: rcm-client.gresource.xml $(shell glib-compile-resources --generate-dependencies rcm-client.gresource.xml) + glib-compile-resources --target=$@ --generate-header --c-name rcm rcm-client.gresource.xml + rcm-client-%.o: rcm-client-%.c $(RCC_HEADERS) $(RCC_COMPILE) -o $@ -c $< diff --git a/rcm-client-main.c b/rcm-client-main.c index 9d6c4e1..f0e267c 100644 --- a/rcm-client-main.c +++ b/rcm-client-main.c @@ -230,7 +230,7 @@ int main(int argc, char *argv[]) gtk_style_context_add_provider_for_screen(screen, GTK_STYLE_PROVIDER(css), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); g_object_unref(css); - global->builder = gtk_builder_new_from_file("rcm-client.ui"); + global->builder = gtk_builder_new_from_resource("/org/gnome/RemoteControlManager/rcm-client.ui"); global->window = GTK_WINDOW(gtk_builder_get_object(global->builder, "main_window")); g_signal_connect(global->window, "destroy", G_CALLBACK(gtk_main_quit), NULL); diff --git a/rcm-client.gresource.xml b/rcm-client.gresource.xml new file mode 100644 index 0000000..a8b918f --- /dev/null +++ b/rcm-client.gresource.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<gresources> + <gresource prefix="/org/gnome/RemoteControlManager"> + <file compressed="true">rcm-client.ui</file> + </gresource> +</gresources> |