Commit e59d8d07 authored by Jonathan Michalon's avatar Jonathan Michalon

Merge branch 'ovccgtk-gtk3' into master as this is the most useful version

parents 0a1c05e0 c8e6d37e
......@@ -15,25 +15,28 @@ ovccgtkdatadir="${datadir}/ovcc-gtk/"
AC_SUBST([ovccgtkdatadir])
# Checks for programs.
AC_PROG_INSTALL
AC_PROG_LN_S
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.12
GLIB_REQUIRE=2.38
GMODULE_REQUIRE=2.0
GTK_REQUIRE=2.20
GTK_REQUIRE=3.10
OVCC_REQUIRE=0.0
PKG_CHECK_MODULES([OVCCGTK], [glib-2.0 >= ${GLIB_REQUIRE}
gthread-2.0 >= ${GLIB_REQUIRE}
gmodule-export-2.0 >= ${GMODULE_REQUIRE}
gtk+-2.0 >= ${GTK_REQUIRE}
gtk+-3.0 >= ${GTK_REQUIRE}
ovcc >= ${OVCC_REQUIRE}
ovccclient >= ${OVCC_REQUIRE}])
......
......@@ -2,13 +2,17 @@
iconsdir = $(datadir)
nobase_dist_icons_DATA = icons/hicolor/scalable/apps/ovccgtk.svg
dist_pkgdata_DATA = ovcc-gtk.ui
dist_noinst_DATA = ovccgtk-application.ui \
ovccgtk-connection-dialog.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
# already searched for
install-data-hook:
( cd "$(pkgdatadir)" && $(RM) icons && $(LN_S) ../icons icons )
( $(INSTALL) -d "$(pkgdatadir)" && \
cd "$(pkgdatadir)" && \
$(RM) icons && \
$(LN_S) ../icons icons )
uninstall-hook:
( test ! -d "$(pkgdatadir)" || ( cd "$(pkgdatadir)" && $(RM) icons ) )
This diff is collapsed.
......@@ -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,11 +38,12 @@ 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) -Wl,--export-dynamic \
-DDATADIR='"$(ovccgtkdatadir)"'
ovcc_gtk_CFLAGS = $(OVCCGTK_CFLAGS) -DDATADIR='"$(ovccgtkdatadir)"'
ovcc_gtk_LDFLAGS = -Wl,--export-dynamic
ovcc_gtk_LDADD = $(OVCCGTK_LIBS) -lm
ovcc_gtk_SOURCES = $(autogen_sources) \
$(autogen_headers) \
......@@ -48,20 +51,57 @@ ovcc_gtk_SOURCES = $(autogen_sources) \
$(headers)
ovccgtk-marshal.h: $(srcdir)/ovccgtk-marshal.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=ovccgtk_marshal > $@
GLIB_GENMARSHAL_FLAGS = --prefix=ovccgtk_marshal
ovccgtk-marshal.c: $(srcdir)/ovccgtk-marshal.list ovccgtk-marshal.h
$(AM_V_GEN) echo '#include "ovccgtk-marshal.h"' > $@ && \
$(GLIB_GENMARSHAL) $< --body --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 .gresource.xml .c .h
.list.h:
$(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header $(GLIB_GENMARSHAL_FLAGS) > $@
.list.c:
$(AM_V_GEN) ( echo '#include "$@"' | $(SED) 's/.c"/.h"/' && \
$(GLIB_GENMARSHAL) $< --body $(GLIB_GENMARSHAL_FLAGS) ) > $@
# we need to hack since our prefix (OVCCGtk) is incorrectly detected as mapping
# to prefix=o sub-prefix=vcc_gtk
ovccgtk-enum-types.c: $(srcdir)/ovccgtk-enum-types.c.tpl ovccgtk-enum-types.h $(headers) Makefile
.c.tpl.c:
$(AM_V_GEN)$(GLIB_MKENUMS) --template $< $(headers:%=$(srcdir)/%) | \
sed s%o_vcc_gtk_%ovccgtk_%g | \
sed s%O_TYPE_VCC_GTK_%OVCCGTK_TYPE_%g > $@
ovccgtk-enum-types.h: $(srcdir)/ovccgtk-enum-types.h.tpl $(headers) Makefile
$(SED) s%o_vcc_gtk_%ovccgtk_%g | \
$(SED) s%O_TYPE_VCC_GTK_%OVCCGTK_TYPE_%g > $@
.h.tpl.h:
$(AM_V_GEN)$(GLIB_MKENUMS) --template $< $(headers:%=$(srcdir)/%) | \
sed s%o_vcc_gtk_%ovccgtk_%g | \
sed s%O_TYPE_VCC_GTK_%OVCCGTK_TYPE_%g > $@
$(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
$(autogen_headers) $(autogen_sources): Makefile
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
......@@ -27,13 +27,13 @@
#include "utils.h"
#include "tiles.h"
#include "ovccgtk-resources.h"
#include "ovccgtk-board.h"
#include "ovccgtk-client.h"
#include "ovccgtk-connection-dialog.h"
#include "ovccgtk-player-list.h"
#define UI_FILE "ovcc-gtk.ui"
#define GAME_TILES "tiles.xml"
#define GAME_TILESET "tileset.xml"
......@@ -410,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_file (builder, path, &err) > 0;
loaded = gtk_builder_add_from_resource (builder, path, &err) > 0;
if (! loaded) {
show_message (NULL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
err->message, _("Failed to load UI file \"%s\""), path);
......@@ -881,8 +881,8 @@ help_about_activate_handler (GtkAction *action,
"program-name", _("OVCCGtk"),
"version", VERSION,
"comments", _("A GTK client for OVCC"),
"copyright", _("\xc2\xa9 2009-2011 Colomban Wendling"),
"license", "GPLv3+",
"copyright", _("Copyright \xc2\xa9 2009-2013 Colomban Wendling"),
"license-type", GTK_LICENSE_GPL_3_0,
"translator-credits", _("translator-credits"),
"authors", authors,
NULL);
......@@ -903,7 +903,7 @@ ovcc_gtk (int argc,
g_free (icon_path);
builder = gtk_builder_new ();
if (load_ui (builder, UI_FILE)) {
if (load_ui (builder, "ovccgtk-application.ui")) {
GtkWidget *players_cnt;
GtkWidget *board_cnt;
App *app;
......@@ -971,7 +971,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;
}
......
This diff is collapsed.
......@@ -63,9 +63,6 @@ struct _OVCCGtkBoardClass
const OVCCPosition *pos,
OVCCTileObject *obj,
OVCCPawnKind kind);
void (*set_scroll_adjustments) (OVCCGtkBoard *board,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
};
......
......@@ -49,7 +49,9 @@ static void ovccgtk_client_get_property (GObject *object,
GParamSpec *pspec);
G_DEFINE_TYPE (OVCCGtkClient, ovccgtk_client, OVCCCLIENT_TYPE_CLIENT)
G_DEFINE_TYPE_WITH_PRIVATE (OVCCGtkClient,
ovccgtk_client,
OVCCCLIENT_TYPE_CLIENT)
static void
......@@ -69,16 +71,12 @@ ovccgtk_client_class_init (OVCCGtkClientClass *klass)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_type_class_add_private ((gpointer) klass, sizeof (OVCCGtkClientPrivate));
}
static void
ovccgtk_client_init (OVCCGtkClient *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
OVCCGTK_TYPE_CLIENT,
OVCCGtkClientPrivate);
self->priv = ovccgtk_client_get_instance_private (self);
self->priv->name = NULL;
}
......@@ -142,54 +140,24 @@ ovccgtk_client_new (const gchar *name)
}
typedef struct
{
OVCCGtkClient *self;
GCancellable *cancellable;
GSimpleAsyncResult *result;
gboolean success;
} JoinData;
static JoinData *
join_data_new (void)
{
JoinData *jdata;
jdata = g_slice_alloc (sizeof *jdata);
return jdata;
}
static void
join_data_free (JoinData *jdata)
{
g_object_unref (jdata->self);
if (jdata->cancellable) {
g_object_unref (jdata->cancellable);
}
g_slice_free1 (sizeof *jdata, jdata);
}
static void
ovccgtk_client_join_table_ready (GObject *object,
GAsyncResult *result,
gpointer data)
{
JoinData *jdata = data;
GError *error = NULL;
GTask *task = data;
GError *error = NULL;
g_debug ("ovccclient_client_join_table_finish()");
if (! ovccclient_client_join_table_finish (OVCCCLIENT_CLIENT (object),
result, &error)) {
ovccclient_client_leave (OVCCCLIENT_CLIENT (object), NULL);
g_simple_async_result_take_error (jdata->result, error);
g_simple_async_result_complete (jdata->result);
g_object_unref (jdata->result);
g_task_return_error (task, error);
g_object_unref (task);
} else {
g_debug ("joined!");
jdata->success = TRUE;
g_simple_async_result_complete (jdata->result);
g_object_unref (jdata->result);
g_task_return_boolean (task, TRUE);
g_object_unref (task);
}
}
......@@ -198,21 +166,20 @@ ovccgtk_client_login_ready (GObject *object,
GAsyncResult *result,
gpointer data)
{
JoinData *jdata = data;
GError *error = NULL;
GTask *task = data;
GError *error = NULL;
g_debug ("ovccclient_client_login_finish()");
if (! ovccclient_client_login_finish (OVCCCLIENT_CLIENT (object), result,
&error)) {
ovccclient_client_leave (OVCCCLIENT_CLIENT (object), NULL);
g_simple_async_result_take_error (jdata->result, error);
g_simple_async_result_complete (jdata->result);
g_object_unref (jdata->result);
g_task_return_error (task, error);
g_object_unref (task);
} else {
g_debug ("ovccclient_client_join_table()");
ovccclient_client_join_table (OVCCCLIENT_CLIENT (object), -1,
jdata->cancellable,
ovccgtk_client_join_table_ready, jdata);
g_task_get_cancellable (task),
ovccgtk_client_join_table_ready, task);
}
}
......@@ -221,20 +188,22 @@ ovccgtk_client_bind_to_ready (GObject *object,
GAsyncResult *result,
gpointer data)
{
JoinData *jdata = data;
GError *error = NULL;
GTask *task = data;
GError *error = NULL;
g_debug ("ovccclient_client_bind_to_finish()");
if (! ovccclient_client_bind_to_finish (OVCCCLIENT_CLIENT (object), result,
&error)) {
g_simple_async_result_take_error (jdata->result, error);
g_simple_async_result_complete (jdata->result);
g_object_unref (jdata->result);
g_task_return_error (task, error);
g_object_unref (task);
} else {
OVCCGtkClient *self = g_task_get_source_object (task);
g_debug ("ovccclient_client_login()");
ovccclient_client_login (OVCCCLIENT_CLIENT (object),
jdata->self->priv->name, "xxx", jdata->cancellable,
ovccgtk_client_login_ready, jdata);
self->priv->name, "xxx",
g_task_get_cancellable (task),
ovccgtk_client_login_ready, task);
}
}
......@@ -245,44 +214,22 @@ ovccgtk_client_join_async (OVCCGtkClient *self,
GAsyncReadyCallback callback,
gpointer data)
{
JoinData *jdata;
GTask *task;
g_return_if_fail (OVCCGTK_IS_CLIENT (self));
g_return_if_fail (OVCCCLIENT_IS_SERVER (server));
g_return_if_fail (self->priv->name != NULL);
jdata = join_data_new ();
jdata->success = FALSE;
jdata->self = g_object_ref (self);
if (cancellable) {
jdata->cancellable = g_object_ref (cancellable);
} else {
jdata->cancellable = NULL;
}
jdata->result = g_simple_async_result_new (G_OBJECT (self), callback, data,
(gpointer) ovccgtk_client_join_async);
g_simple_async_result_set_op_res_gpointer (jdata->result, jdata,
(GDestroyNotify) join_data_free);
task = g_task_new (self, cancellable, callback, data);
g_debug ("ovccclient_client_bind_to()");
ovccclient_client_bind_to (OVCCCLIENT_CLIENT (self), server,
jdata->cancellable, ovccgtk_client_bind_to_ready,
jdata);
cancellable, ovccgtk_client_bind_to_ready, task);
}
gboolean
ovccgtk_client_join_finish (GAsyncResult *result,
GError **error)
{
gboolean success = FALSE;
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
if (! g_simple_async_result_propagate_error (simple, error)) {
JoinData *jdata;
jdata = g_simple_async_result_get_op_res_gpointer (simple);
success = jdata->success;
}
return success;
return g_task_propagate_boolean (G_TASK (result), error);
}
......@@ -34,7 +34,7 @@ struct _OVCCGtkFramePrivate
};
G_DEFINE_TYPE (OVCCGtkFrame, ovccgtk_frame, GTK_TYPE_FRAME)
G_DEFINE_TYPE_WITH_PRIVATE (OVCCGtkFrame, ovccgtk_frame, GTK_TYPE_FRAME)
static void
......@@ -70,8 +70,6 @@ ovccgtk_frame_class_init (OVCCGtkFrameClass *klass)
object_class->finalize = ovccgtk_frame_finalize;
container_class->add = ovccgtk_frame_add;
g_type_class_add_private (klass, sizeof (OVCCGtkFramePrivate));
}
static void
......@@ -79,8 +77,8 @@ ovccgtk_frame_label_notify (GObject *object,
GParamSpec *pspec,
gpointer data)
{
OVCCGtkFrame *self = OVCCGTK_FRAME (object);
GtkWidget *label;
OVCCGtkFrame *self = OVCCGTK_FRAME (object);
GtkWidget *label;
label = gtk_frame_get_label_widget (GTK_FRAME (self));
if (label) {
......@@ -91,9 +89,7 @@ ovccgtk_frame_label_notify (GObject *object,
static void
ovccgtk_frame_init (OVCCGtkFrame *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
OVCCGTK_TYPE_FRAME,
OVCCGtkFramePrivate);
self->priv = ovccgtk_frame_get_instance_private (self);
/* set-up the frame attributes */
gtk_frame_set_shadow_type (GTK_FRAME (self), GTK_SHADOW_NONE);
......
......@@ -56,9 +56,9 @@ static void ovccgtk_message_info_set_propery (GObject *obj
GParamSpec *pspec);
G_DEFINE_TYPE (OVCCGtkMessageInfo,
ovccgtk_message_info,
GTK_TYPE_INFO_BAR)
G_DEFINE_TYPE_WITH_PRIVATE (OVCCGtkMessageInfo,
ovccgtk_message_info,
GTK_TYPE_INFO_BAR)
enum
......@@ -69,10 +69,15 @@ enum
PROP_SECONDARY_TEXT,
PROP_SECONDARY_USE_MARKUP,
PROP_TEXT,
PROP_USE_MARKUP
PROP_USE_MARKUP,
N_PROPERTIES
};
static GParamSpec *properties[N_PROPERTIES] = { NULL };
static void
ovccgtk_message_info_class_init (OVCCGtkMessageInfoClass *klass)
{
......@@ -83,47 +88,46 @@ ovccgtk_message_info_class_init (OVCCGtkMessageInfoClass *klass)
object_class->set_property = ovccgtk_message_info_set_propery;
widget_class->show_all = gtk_widget_show;
widget_class->hide_all = gtk_widget_hide;
g_object_class_install_property (object_class, PROP_BUTTONS,
g_param_spec_enum ("buttons",
"Buttons",
"The buttons shown in the message info",
GTK_TYPE_BUTTONS_TYPE,
GTK_BUTTONS_NONE,
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_SECONDARY_TEXT,
g_param_spec_string ("secondary-text",
"Secondary text",
"The secondary text",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_SECONDARY_USE_MARKUP,
g_param_spec_boolean ("secondary-use-markup",
"Secondary use markup",
"Whether the secondary text uses Pango markup",
FALSE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_TEXT,
g_param_spec_string ("text",
"Text",
"The primary text",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_USE_MARKUP,
g_param_spec_boolean ("use-markup",
"Use markup",
"Whether the primary text uses Pango markup",
FALSE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_type_class_add_private (klass, sizeof (OVCCGtkMessageInfoPrivate));
properties[PROP_BUTTONS] =
g_param_spec_enum ("buttons",
"Buttons",
"The buttons shown in the message info",
GTK_TYPE_BUTTONS_TYPE,
GTK_BUTTONS_NONE,
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
properties[PROP_SECONDARY_TEXT] =
g_param_spec_string ("secondary-text",
"Secondary text",
"The secondary text",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
properties[PROP_SECONDARY_USE_MARKUP] =
g_param_spec_boolean ("secondary-use-markup",
"Secondary use markup",
"Whether the secondary text uses Pango markup",
FALSE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
properties[PROP_TEXT] =
g_param_spec_string ("text",
"Text",
"The primary text",
NULL,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
properties[PROP_USE_MARKUP] =
g_param_spec_boolean ("use-markup",
"Use markup",
"Whether the primary text uses Pango markup",
FALSE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, N_PROPERTIES, properties);
}
static void
......@@ -133,15 +137,14 @@ ovccgtk_message_info_init (OVCCGtkMessageInfo *self)
GtkWidget *box;
GtkWidget *label_box;
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, OVCCGTK_TYPE_MESSAGE_INFO,
OVCCGtkMessageInfoPrivate);
self->priv = ovccgtk_message_info_get_instance_private (self);
self->priv->icon = gtk_image_new ();
self->priv->primary_label = ovccgtk_wrap_label_new (NULL);
self->priv->secondary_label = ovccgtk_wrap_label_new (NULL);
box = gtk_hbox_new (FALSE, 6);
label_box = gtk_vbox_new (FALSE, 12);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
label_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_box_pack_start (GTK_BOX (box), self->priv->icon, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), label_box, TRUE, TRUE, 0);
......@@ -352,7 +355,7 @@ ovccgtk_message_info_set_use_markup (OVCCGtkMessageInfo *self,
gtk_label_set_use_markup (GTK_LABEL (self->priv->primary_label),
use_markup);
update_label_tooltip (self);
g_object_notify (G_OBJECT (self), "use-markup");
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_USE_MARKUP]);
}
}
......@@ -391,7 +394,8 @@ ovccgtk_message_info_set_secondary_use_markup (OVCCGtkMessageInfo *self,
if (gtk_label_get_use_markup (GTK_LABEL (self->priv->secondary_label)) != use_markup) {
gtk_label_set_use_markup (GTK_LABEL (self->priv->secondary_label),
use_markup);
g_object_notify (G_OBJECT (self), "secondary-use-markup");
g_object_notify_by_pspec (G_OBJECT (self),
properties[PROP_SECONDARY_USE_MARKUP]);
}
}
......@@ -426,7 +430,7 @@ ovccgtk_message_info_set_secondary_label (OVCCGtkMessageInfo *self,
}
gtk_widget_set_visible (self->priv->secondary_label, label != NULL);
g_object_notify (G_OBJECT (self), "secondary-text");
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SECONDARY_TEXT]);
}
const gchar *
......
......@@ -57,11 +57,11 @@ GType ovccgtk_message_info_get_type (void) G_GNUC_CONST;
GtkWidget *ovccgtk_message_info_new (GtkMessageType type,
GtkButtonsType buttons,
const gchar *format,
...);
...) G_GNUC_PRINTF (3, 4);
GtkWidget *ovccgtk_message_info_new_with_markup (GtkMessageType type,
GtkButtonsType buttons,
const gchar *format,
...);
...) G_GNUC_PRINTF (3, 4);
void ovccgtk_message_info_set_label (OVCCGtkMessageInfo *self,
const gchar *label);
const gchar *ovccgtk_message_info_get_label (OVCCGtkMessageInfo *self);
......@@ -76,10 +76,10 @@ void ovccgtk_message_info_set_secondary_use_markup (OVCCGtkMessageInfo
gboolean ovccgtk_message_info_get_secondary_use_markup (OVCCGtkMessageInfo *self);
void ovccgtk_message_info_format_secondary_text (OVCCGtkMessageInfo *self,
const gchar *format,
...);
...) G_GNUC_PRINTF (2, 3);
void ovccgtk_message_info_format_secondary_markup (OVCCGtkMessageInfo *self,
const gchar *format,
...);
...) G_GNUC_PRINTF (2, 3);
G_END_DECLS
......
......@@ -75,9 +75,9 @@ static void set_text_cell_data (GtkCellLayout *cell_la
gpointer data);
G_DEFINE_TYPE (OVCCGtkPlayerList,
ovccgtk_player_list,
GTK_TYPE_TREE_VIEW)
G_DEFINE_TYPE_WITH_PRIVATE (OVCCGtkPlayerList,
ovccgtk_player_list,
GTK_TYPE_TREE_VIEW)
enum
......@@ -85,10 +85,15 @@ enum
PROP_0,
PROP_DEFAULT_PLAYER,
PROP_GAME
PROP_GAME,
N_PROPERTIES
};
static GParamSpec *properties[N_PROPERTIES] = { NULL };
static void
ovccgtk_player_list_class_init (OVCCGtkPlayerListClass *klass)
{
......@@ -105,22 +110,22 @@ ovccgtk_player_list_class_init (OVCCGtkPlayerListClass *klass)
widget_class->button_press_event = ovccgtk_player_list_button_press;
widget_class->button_release_event = ovccgtk_player_list_button_release;
g_object_class_install_property (object_class, PROP_DEFAULT_PLAYER,
g_param_spec_object ("default-player",
"Default player",
"The default player",
OVCC_TYPE_PLAYER,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_GAME,
g_param_spec_object ("game",
"Game",
"The game for which show players",
OVCC_TYPE_GAME,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
properties[PROP_DEFAULT_PLAYER] =
g_param_spec_object ("default-player",
"Default player",
"The default player",
OVCC_TYPE_PLAYER,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
properties[PROP_GAME] =
g_param_spec_object ("game",
"Game",
"The game for which show players",
OVCC_TYPE_GAME,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_type_class_add_private (klass, sizeof (OVCCGtkPlayerListPrivate));
g_object_class_install_properties (object_class, N_PROPERTIES, properties);
}
static void
......@@ -129,8 +134,7 @@ ovccgtk_player_list_init (OVCCGtkPlayerList *self)
GtkTreeViewColumn *column;
GtkCellRenderer *cell;
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, OVCCGTK_TYPE_PLAYER_LIST,
OVCCGtkPlayerListPrivate);
self->priv = ovccgtk_player_list_get_instance_private (self);
self->priv->store = gtk_list_store_new (1, OVCC_TYPE_PLAYER);
self->priv->default_player = NULL;
......@@ -272,9 +276,8 @@ set_text_cell_data (GtkCellLayout *cell_layout,
GtkTreeIter *iter,
gpointer data)
{