Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Open Virtual Carcassonne Clone
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Colomban Wendling
Open Virtual Carcassonne Clone
Commits
ab17ab5d
Commit
ab17ab5d
authored
Jan 08, 2014
by
Colomban Wendling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OVCCGtk: use GResource to store our UI file
parent
8915f665
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
6 deletions
+42
-6
clients/ovcc-gtk/configure.ac
clients/ovcc-gtk/configure.ac
+2
-1
clients/ovcc-gtk/data/Makefile.am
clients/ovcc-gtk/data/Makefile.am
+1
-1
clients/ovcc-gtk/src/Makefile.am
clients/ovcc-gtk/src/Makefile.am
+28
-2
clients/ovcc-gtk/src/main.c
clients/ovcc-gtk/src/main.c
+5
-2
clients/ovcc-gtk/src/ovccgtk-resources.gresource.xml
clients/ovcc-gtk/src/ovccgtk-resources.gresource.xml
+6
-0
No files found.
clients/ovcc-gtk/configure.ac
View file @
ab17ab5d
...
...
@@ -20,13 +20,14 @@ AC_PROG_SED
AC_PROG_CC
AM_PROG_VALAC([0.7])
AC_CHECK_PROGS([GLIB_GENMARSHAL], [glib-genmarshal], [NONE])
AC_CHECK_PROGS([GLIB_COMPILE_RESOURCES], [glib-compile-resources], [NONE])
AC_CHECK_PROGS([GLIB_MKENUMS], [glib-mkenums], [NONE])
# check for gtk-doc
#GTK_DOC_CHECK(1.11)
# Checks for libraries.
GLIB_REQUIRE=2.
1
2
GLIB_REQUIRE=2.
3
2
GMODULE_REQUIRE=2.0
GTK_REQUIRE=3.0
OVCC_REQUIRE=0.0
...
...
clients/ovcc-gtk/data/Makefile.am
View file @
ab17ab5d
...
...
@@ -2,7 +2,7 @@
iconsdir
=
$(datadir)
nobase_dist_icons_DATA
=
icons/hicolor/scalable/apps/ovccgtk.svg
dist_
pkgdata_DATA
=
ovccgtk-application.ui
dist_
noinst_DATA
=
ovccgtk-application.ui
# we add directory $(pkgdatadir)/icons to our lookup path, so make sure it
# exists in case we aren't installed in a default prefix where icons are
...
...
clients/ovcc-gtk/src/Makefile.am
View file @
ab17ab5d
...
...
@@ -27,8 +27,10 @@ headers = ovccgtk-board.h \
tiles.h
autogen_sources
=
ovccgtk-marshal.c
\
ovccgtk-resources.c
\
ovccgtk-enum-types.c
autogen_headers
=
ovccgtk-marshal.h
\
ovccgtk-resources.h
\
ovccgtk-enum-types.h
CLEANFILES
=
$(autogen_sources)
\
...
...
@@ -36,7 +38,8 @@ CLEANFILES = $(autogen_sources) \
EXTRA_DIST
=
ovccgtk-marshal.list
\
ovccgtk-enum-types.c.tpl
\
ovccgtk-enum-types.h.tpl
ovccgtk-enum-types.h.tpl
\
ovccgtk-resources.gresource.xml
ovcc_gtk_CFLAGS
=
$(OVCCGTK_CFLAGS)
-DDATADIR
=
'"
$(ovccgtkdatadir)
"'
...
...
@@ -50,8 +53,11 @@ ovcc_gtk_SOURCES = $(autogen_sources) \
GLIB_GENMARSHAL_FLAGS
=
--prefix
=
ovccgtk_marshal
GLIB_COMPILE_RESOURCES_SOURCEDIR
=
$(top_srcdir)
/data
GLIB_COMPILE_RESOURCES_FLAGS
=
--internal
--manual-register
--c-name
=
ovccgtk
SUFFIXES
=
.list .c.tpl .h.tpl .c .h
SUFFIXES
=
.list .c.tpl .h.tpl .gresource.xml .c .h
.list.h
:
$(AM_V_GEN)
$(GLIB_GENMARSHAL)
$<
--header
$(GLIB_GENMARSHAL_FLAGS)
>
$@
...
...
@@ -70,6 +76,21 @@ SUFFIXES = .list .c.tpl .h.tpl .c .h
$(SED)
s%o_vcc_gtk_%ovccgtk_%g |
\
$(SED)
s%O_TYPE_VCC_GTK_%OVCCGTK_TYPE_%g
>
$@
.gresource.xml.h
:
$(AM_V_GEN)
$(GLIB_COMPILE_RESOURCES)
$<
--target
=
$@
--generate-header
\
$(GLIB_COMPILE_RESOURCES_FLAGS)
\
--sourcedir
=
$(GLIB_COMPILE_RESOURCES_SOURCEDIR)
&&
\
(
echo
$@
:
&&
$(GLIB_COMPILE_RESOURCES)
$<
\
--sourcedir
=
$(GLIB_COMPILE_RESOURCES_SOURCEDIR)
\
--generate-dependencies
)
|
$(SED)
's/$$/\\/'
>
.deps/
$@
.deps
.gresource.xml.c
:
$(AM_V_GEN)
$(GLIB_COMPILE_RESOURCES)
$<
--target
=
$@
--generate-source
\
$(GLIB_COMPILE_RESOURCES_FLAGS)
\
--sourcedir
=
$(GLIB_COMPILE_RESOURCES_SOURCEDIR)
&&
\
(
echo
$@
:
&&
$(GLIB_COMPILE_RESOURCES)
$<
\
--sourcedir
=
$(GLIB_COMPILE_RESOURCES_SOURCEDIR)
\
--generate-dependencies
)
|
$(SED)
's/$$/\\/'
>
.deps/
$@
.deps
# explicit dependencies of our generated files
...
...
@@ -79,3 +100,8 @@ ovccgtk-marshal.c: ovccgtk-marshal.h
ovccgtk-enum-types.c
:
ovccgtk-enum-types.h $(headers)
ovccgtk-enum-types.h
:
$(headers)
-include
.deps/ovccgtk-resources.h.deps
-include
.deps/ovccgtk-resources.c.deps
ovccgtk-resources.c
:
ovccgtk-resources.h
clients/ovcc-gtk/src/main.c
View file @
ab17ab5d
...
...
@@ -27,6 +27,7 @@
#include "utils.h"
#include "tiles.h"
#include "ovccgtk-resources.h"
#include "ovccgtk-board.h"
#include "ovccgtk-client.h"
#include "ovccgtk-connection-dialog.h"
...
...
@@ -409,9 +410,9 @@ load_ui (GtkBuilder *builder,
{
GError
*
err
=
NULL
;
gboolean
loaded
=
FALSE
;
gchar
*
path
=
data_get_path
(
filename
);
gchar
*
path
=
g_build_filename
(
"/org/ovccgtk/widgets"
,
filename
,
NULL
);
loaded
=
gtk_builder_add_from_
fil
e
(
builder
,
path
,
&
err
)
>
0
;
loaded
=
gtk_builder_add_from_
resourc
e
(
builder
,
path
,
&
err
)
>
0
;
if
(
!
loaded
)
{
show_message
(
NULL
,
GTK_MESSAGE_ERROR
,
GTK_BUTTONS_CLOSE
,
err
->
message
,
_
(
"Failed to load UI file
\"
%s
\"
"
),
path
);
...
...
@@ -996,7 +997,9 @@ main (int argc,
int
rv
=
1
;
gtk_init
(
&
argc
,
&
argv
);
ovccgtk_register_resource
();
rv
=
ovcc_gtk
(
argc
,
argv
)
?
0
:
1
;
ovccgtk_unregister_resource
();
return
rv
;
}
...
...
clients/ovcc-gtk/src/ovccgtk-resources.gresource.xml
0 → 100644
View file @
ab17ab5d
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource
prefix=
"/org/ovccgtk/widgets"
>
<file
preprocess=
"xml-stripblanks"
>
ovccgtk-application.ui
</file>
</gresource>
</gresources>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment