Commit 002af3dd authored by Bruno Coudoin's avatar Bruno Coudoin
Browse files

Fixed gcompris2spip to work with spip 1.8.2

	Commit of XRANDR patch from debian Bug report logs - #310058
parent 2df95616
2005-09-18 Bruno coudoin <bruno.coudoin@free.fr>
Fixed gcompris2spip to work with spip 1.8.2
Commit of XRANDR patch from debian Bug report logs - #310058
* INSTALL:
* boards/hanoi_real.xml.in:
* docs/screenshots/memory_tux.jpg:
* docs/screenshots/memory_tux_small.jpg:
* docs/screenshots/tuxpaint.jpg:
* docs/screenshots/tuxpaint_small.jpg:
* docs/spip_menuboard.xsl:
* docs/spip_oneboard.xsl:
* po/Makefile.in.in:
* src/gcompris/gcompris.c: (init_background), (gcompris_exit),
(xrandr_init), (xrandr_get_config):
* src/gcompris/properties.c: (gcompris_properties_save):
2005-09-18 Yves Combe,,, <yves@ycombe.net>
try to fix dependances on gtk 2.4 and not 2.6
......
......@@ -35,7 +35,7 @@ libSDL libSDL-mixer
On a Mandriva, you will need to install their -devel counterpart package in
order to be abble to compile it plus intltool, tetex.
In order to compile gcompris on a mandrake 10.1 you must install :
In order to compile gcompris on a mandrake 10.2 you must install :
urpmi pkgconfig
urpmi autoconf2.5
urpmi glib-gettext
......
......@@ -5,7 +5,7 @@
type="hanoi_real"
section="/boards"
icon="boardicons/hanoi_real.png"
difficulty="0"
difficulty="3"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
boarddir="">
<_title>The Tower of Hanoi</_title>
......
......@@ -35,9 +35,14 @@
<nom_site>__REMOVEME__</nom_site>
<url_site>__REMOVEME__</url_site>
<extra>__REMOVEME__</extra>
<idx>oui</idx>
<idx>1</idx>
<id_version>0</id_version>
<lien_auteur>1</lien_auteur>
<surtitre>__REMOVEME__</surtitre>
<soustitre>__REMOVEME__</soustitre>
<descriptif>__REMOVEME__</descriptif>
<chapo>__REMOVEME__</chapo>
<url_propre>__REMOVEME__</url_propre>
<ps>__REMOVEME__</ps>
<xsl:for-each select="GComprisBoards/GCompris/Board[@name=$name]">
......
......@@ -36,7 +36,7 @@
<nom_site>__REMOVEME__</nom_site>
<url_site>__REMOVEME__</url_site>
<extra>__REMOVEME__</extra>
<idx>oui</idx>
<idx>1</idx>
<id_version>0</id_version>
<lien_auteur>1</lien_auteur>
<ps>__REMOVEME__</ps>
......
......@@ -45,7 +45,6 @@ INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
CC = @CC@
GENCAT = @GENCAT@
GMSGFMT = @GMSGFMT@
MSGFMT = @MSGFMT@
XGETTEXT = @XGETTEXT@
......@@ -73,7 +72,6 @@ POTFILES = \
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
INSTOBJEXT = @INSTOBJEXT@
.SUFFIXES:
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
......@@ -94,7 +92,7 @@ INSTOBJEXT = @INSTOBJEXT@
.po.cat:
sed -f ../intl/po2msg.sed < $< > $*.msg \
&& rm -f $@ && $(GENCAT) $@ $*.msg
&& rm -f $@ && gencat $@ $*.msg
all: all-@USE_NLS@
......@@ -130,22 +128,22 @@ install-data-yes: all
$(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
fi; \
if test -r $$cat; then \
$(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
$(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE).mo; \
echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE).mo"; \
else \
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE).mo; \
echo "installing $(srcdir)/$$cat as" \
"$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \
"$$dir/$(GETTEXT_PACKAGE).mo"; \
fi; \
if test -r $$cat.m; then \
$(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
$(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
else \
if test -r $(srcdir)/$$cat.m ; then \
$(INSTALL_DATA) $(srcdir)/$$cat.m \
$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
$$dir/$(GETTEXT_PACKAGE).mo.m; \
echo "installing $(srcdir)/$$cat as" \
"$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \
"$$dir/$(GETTEXT_PACKAGE).mo.m"; \
else \
true; \
fi; \
......@@ -171,10 +169,10 @@ uninstall:
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
done
if test "$(PACKAGE)" = "glib"; then \
rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
......
......@@ -173,6 +173,7 @@ static gboolean changed_xrandr = FALSE;
static SizeID xr_previous_size = -1;
static XRANDRData *xrandr;
static void xrandr_init ( XRANDRData *data );
static void xrandr_get_config ( XRANDRData *data );
gboolean xrandr_set_config( XRANDRData *grandr );
#endif
......@@ -322,36 +323,37 @@ static void init_background()
GtkWidget *vbox;
int i;
screen_height = gdk_screen_height();
screen_width = gdk_screen_width();
#ifdef XRANDR
/* Search the 800x600 Resolution */
if(properties->fullscreen && !properties->noxrandr) {
g_warning("XRANDR Is compiled in. Searching a good resolution");
xrandr = g_new0 (XRANDRData, 1);
xrandr_get_config ( xrandr );
xr_previous_size = (SizeID)xrandr->xr_current_size;
for (i = 0; i < xrandr->xr_nsize; i++) {
if(xrandr->xr_sizes[i].width == BOARDWIDTH, xrandr->xr_sizes[i].height == BOARDHEIGHT+BARHEIGHT) {
xrandr->xr_current_size = (SizeID)i;
xrandr_set_config( xrandr );
changed_xrandr = TRUE;
break;
xrandr_init ( xrandr );
/* Check if XRANDR is available */
if (!properties->noxrandr) {
xrandr_get_config ( xrandr );
xr_previous_size = (SizeID)xrandr->xr_current_size;
for (i = 0; i < xrandr->xr_nsize; i++) {
if(xrandr->xr_sizes[i].width == BOARDWIDTH, xrandr->xr_sizes[i].height == BOARDHEIGHT+BARHEIGHT) {
xrandr->xr_current_size = (SizeID)i;
xrandr_set_config( xrandr );
break;
}
}
screen_height = xrandr->xr_sizes[xrandr->xr_current_size].height;
screen_width = xrandr->xr_sizes[xrandr->xr_current_size].width;
}
screen_height = xrandr->xr_sizes[xrandr->xr_current_size].height;
screen_width = xrandr->xr_sizes[xrandr->xr_current_size].width;
} else {
screen_height = gdk_screen_height();
screen_width = gdk_screen_width();
}
#else
screen_height = gdk_screen_height();
screen_width = gdk_screen_width();
#endif
yratio=screen_height/(float)(BOARDHEIGHT+BARHEIGHT);
xratio=screen_width/(float)BOARDWIDTH;
yratio=screen_height/(float)(BOARDHEIGHT+BARHEIGHT);
xratio=screen_width/(float)BOARDWIDTH;
g_message("The screen_width=%f screen_height=%f\n",
(double)screen_width, (double)screen_height);
g_message("The xratio=%f yratio=%f\n", xratio, yratio);
......@@ -717,7 +719,7 @@ void gcompris_exit()
#ifdef XRANDR
/* Set back the original screen size */
if((properties->fullscreen || changed_xrandr) && properties->noxrandr == 0)
if(properties->fullscreen && !properties->noxrandr)
{
/* Need to refresh our config or xrandr api will reject us */
xrandr_get_config ( xrandr );
......@@ -871,10 +873,24 @@ void gcompris_log_handler (const gchar *log_domain,
* ------------
*/
static void
xrandr_get_config ( XRANDRData *data )
xrandr_init ( XRANDRData *data )
{
data->xr_screen_conf = XRRGetScreenInfo (GDK_DISPLAY(), GDK_ROOT_WINDOW());
if (data->xr_screen_conf == NULL)
{
g_warning("XRANDR not available");
properties->noxrandr = TRUE;
}
else
g_warning("XRANDR support enabled");
}
static void
xrandr_get_config ( XRANDRData *data )
{
xrandr_init (data);
data->xr_current_size = XRRConfigCurrentConfiguration (data->xr_screen_conf,
&data->xr_current_rotation);
......
/* gcompris - properties.c
*
* Time-stamp: <2005/08/25 22:58:04 yves>
* Time-stamp: <2005/09/18 18:00:12 bruno>
*
* Copyright (C) 2000,2003 Bruno Coudoin
*
......@@ -332,7 +332,9 @@ void gcompris_properties_save (GcomprisProperties *props)
fprintf(filefd, "%s=%d\n", "fx", props->fx);
fprintf(filefd, "%s=%d\n", "screensize", props->screensize);
fprintf(filefd, "%s=%d\n", "fullscreen", props->fullscreen);
fprintf(filefd, "%s=%d\n", "noxrandr", props->noxrandr);
/* FIXME: No more persist the noxrandr option until we provide a way to set it back
*
fprintf(filefd, "%s=%d\n", "noxrandr", props->noxrandr); */
fprintf(filefd, "%s=%d\n", "timer", props->timer);
fprintf(filefd, "%s=%d\n", "difficulty_filter", props->difficulty_filter);
fprintf(filefd, "%s=%d\n", "filter_style", props->filter_style);
......
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