Commit de708308 authored by Yves Combe's avatar Yves Combe
Browse files

fix all boards after IMContext installation. At least gletters needs to be...

fix all boards after IMContext installation. At least gletters needs to be rewritten. anim/draw use IMContext, others desactive it. Add a gcomprisBoard->disable_im_context for that.
clean gcompris.c from timer stuff and output.
fix connect4p/minmax from psyco import.
parent 14b11116
2005-09-22 Yves Combe,,, <yves@ycombe.net>
fix all boards after IMContext installation. At least gletters needs to be rewritten. anim/draw use IMContext, others desactive it. Add a gcomprisBoard->disable_im_context for that.
clean gcompris.c from timer stuff and output.
fix connect4p/minmax from psyco import.
* src/boards/algebra.c: (start_board), (key_press):
* src/boards/draw.c: (start_board):
* src/boards/enumerate.c: (start_board):
* src/boards/maze.c: (start_board):
* src/boards/paratrooper.c: (start_board):
* src/boards/planegame.c: (start_board):
* src/boards/py-gcompris-board.c: (pyGcomprisBoardType_getattr),
(pyGcomprisBoardType_setattr):
* src/boards/python/anim.py:
* src/boards/python/ballcatch.py:
* src/boards/python/connect4p/minmax.py:
* src/boards/python/gnumch.py:
* src/boards/python/login.py:
* src/boards/python/melody.py:
* src/boards/python/pythontest.py:
* src/boards/python/sudoku.py:
* src/boards/reversecount.c: (start_board):
* src/boards/shapegame.c: (start_board):
* src/boards/smallnumbers.c: (start_board):
* src/boards/target.c: (start_board):
* src/boards/wordsgame.c: (start_board):
* src/gcompris/board.c: (board_run_next_end):
* src/gcompris/gcompris-board.h:
* src/gcompris/gcompris.c: (board_widget_key_press_callback),
(setup_window), (gcompris_exit), (gcompris_init):
* src/gcompris/gcompris_im.h:
2005-09-21 Bruno coudoin <bruno.coudoin@free.fr>
* configure.in: HEAD is not 7.1
......
/* gcompris - algebra.c
*
* Time-stamp: <2005/09/19 23:14:52 yves>
* Time-stamp: <2005/09/21 22:59:56 yves>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -152,6 +152,9 @@ static void start_board (GcomprisBoard *agcomprisBoard)
{
gcomprisBoard=agcomprisBoard;
/* disable im_context */
gcomprisBoard->disable_im_context = TRUE;
gcompris_set_background(gnome_canvas_root(gcomprisBoard->canvas), "images/scenery2_background.png");
/* set initial values for this level */
......@@ -217,12 +220,6 @@ set_level (guint level)
static gint key_press(guint keyval, gchar *commit_str, gchar *preedit_str)
{
if (preedit_str)
return;
g_warning("key_press: %d %s %s %s", keyval, gdk_keyval_name (keyval), commit_str, preedit_str);
guint c;
gboolean stop = FALSE;
......
......@@ -262,6 +262,9 @@ static void start_board (GcomprisBoard *agcomprisBoard)
{
gcomprisBoard=agcomprisBoard;
/* disable im_context */
gcomprisBoard->disable_im_context = TRUE;
gcompris_set_background(gnome_canvas_root(gcomprisBoard->canvas),
gcompris_image_to_skin("gcompris-bg.jpg"));
......
......@@ -140,6 +140,9 @@ static void start_board (GcomprisBoard *agcomprisBoard)
if(agcomprisBoard!=NULL)
{
/* disable im_context */
gcomprisBoard->disable_im_context = TRUE;
gcomprisBoard=agcomprisBoard;
gcomprisBoard->level=1;
gcomprisBoard->maxlevel=5;
......
......@@ -184,6 +184,10 @@ static void start_board (GcomprisBoard *agcomprisBoard) {
if(agcomprisBoard!=NULL) {
gcomprisBoard=agcomprisBoard;
/* disable im_context */
gcomprisBoard->disable_im_context = TRUE;
gcompris_set_background(gnome_canvas_root(gcomprisBoard->canvas),
gcompris_image_to_skin("gcompris-bg.jpg"));
gcomprisBoard->level=1;
......
/* gcompris - paratrooper.c
*
* Time-stamp: <2005/09/15 00:19:23 yves>
* Time-stamp: <2005/09/21 23:04:36 yves>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -181,6 +181,9 @@ static void start_board (GcomprisBoard *agcomprisBoard)
{
gcomprisBoard=agcomprisBoard;
/* disable im_context */
gcomprisBoard->disable_im_context = TRUE;
gcompris_set_background(gnome_canvas_root(gcomprisBoard->canvas), "images/scenery3_background.png");
......
/* gcompris - planegame.c
*
* Time-stamp: <2005/09/15 00:18:56 yves>
* Time-stamp: <2005/09/21 23:08:13 yves>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -143,6 +143,9 @@ static void start_board (GcomprisBoard *agcomprisBoard)
{
gcomprisBoard=agcomprisBoard;
/* disable im_context */
gcomprisBoard->disable_im_context = TRUE;
gcompris_set_background(gnome_canvas_root(gcomprisBoard->canvas), "images/scenery3_background.png");
......
......@@ -54,6 +54,8 @@ pyGcomprisBoardType_getattr(pyGcomprisBoardObject *self, char *name)
}
}
if(strcmp(name,"disable_im_context")==0) return PyBool_FromLong(self->cdata->disable_im_context);
/* Board specific mode */
if(strcmp(name,"mode")==0) return Py_BuildValue("s", self->cdata->mode);
......@@ -158,6 +160,11 @@ pyGcomprisBoardType_setattr(pyGcomprisBoardObject *self, char *name, PyObject *v
self->cdata->number_of_sublevel=value;
return 0;
}
if (strcmp(name,"disable_im_context")==0){
value = PyObject_IsTrue( v);
self->cdata->disable_im_context = value;
return 0;
}
/* Other members are supposed to be read only */
return -1;
......
......@@ -437,7 +437,6 @@ class Gcompris_anim:
print("Gcompris_anim config.")
def key_press(self, keyval, commit_str, preedit_str):
print keyval, commit_str, preedit_str
#
# I suppose codec is the stdin one.
#
......
......@@ -20,6 +20,8 @@ class Gcompris_ballcatch:
def __init__(self, gcomprisBoard):
self.gcomprisBoard = gcomprisBoard
self.gcomprisBoard.disable_im_context = True
# These are used to let us restart only after the bonus is displayed.
# When the bonus is displayed, it call us first with pause(1) and then with pause(0)
self.board_paused = 0;
......
......@@ -42,12 +42,6 @@
# This software is licensed under the GPL - General Public License #
#########################################################################
try:
import psyco
except ImportError:
print "Not using psyco (psyco.sf.net), AI not a maximum speed!"
import rules
from player import *
from random import *
......
......@@ -635,6 +635,7 @@ class Gcompris_gnumch:
game = self
self.board = board
self.board.disable_im_context = True
self.scrw = gcompris.BOARD_WIDTH
self.scrh = gcompris.BOARD_HEIGHT
self.width = 6
......@@ -839,15 +840,8 @@ class Gcompris_gnumch:
self.squares[x][y].setNum(new)
def key_press(self, keyval, commit_str, preedit_str):
if ((commit_str != None) or (preedit_str != None)):
if ((' ' in commit_str) or (' ' in preedit_str)):
key = gtk.keysyms.space
else:
key = 0
else:
key = keyval
self.muncher.push_key(key)
return False
self.muncher.push_key(keyval)
return True
def stopGame(self):
self.stopped = 1
......
......@@ -50,6 +50,8 @@ class Gcompris_login:
def __init__(self, gcomprisBoard):
self.gcomprisBoard = gcomprisBoard
self.gcomprisBoard.disable_im_context = True
print("Gcompris_login __init__.")
......
......@@ -35,6 +35,9 @@ class Gcompris_melody:
def __init__(self, gcomprisBoard):
self.gcomprisBoard = gcomprisBoard
self.gcomprisBoard.disable_im_context = True
print("Gcompris_melody __init__.")
# These are used to let us restart only after the bonux is displayed.
......
......@@ -17,6 +17,9 @@ class Gcompris_pythontest:
def __init__(self, gcomprisBoard):
self.gcomprisBoard = gcomprisBoard
self.gcomprisBoard.disable_im_context = True
self.canvasitems = {}
self.colors = {}
......
......@@ -35,6 +35,8 @@ class Gcompris_sudoku:
def __init__(self, gcomprisBoard):
self.gcomprisBoard = gcomprisBoard
self.gcomprisBoard.disable_im_context = True
# These are used to let us restart only after the bonus is displayed.
# When the bonus is displayed, it call us first with pause(1) and then with pause(0)
self.board_paused = 0;
......
......@@ -190,6 +190,10 @@ static void start_board (GcomprisBoard *agcomprisBoard)
if(agcomprisBoard!=NULL)
{
gcomprisBoard=agcomprisBoard;
/* disable im_context */
gcomprisBoard->disable_im_context = TRUE;
gcomprisBoard->level=1;
gcomprisBoard->maxlevel=7;
gcomprisBoard->sublevel=1;
......
/* gcompris - shapegame.c
*
* Time-stamp: <2005/09/15 00:09:39 yves>
* Time-stamp: <2005/09/21 23:10:20 yves>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -235,6 +235,9 @@ static void start_board (GcomprisBoard *agcomprisBoard)
{
gcomprisBoard=agcomprisBoard;
/* disable im_context */
gcomprisBoard->disable_im_context = TRUE;
/* set initial values for this level */
gcomprisBoard->level = 1;
......
/* gcompris - smallnumbers.c
*
* Time-stamp: <2005/09/15 00:09:07 yves>
* Time-stamp: <2005/09/21 23:10:56 yves>
*
* Copyright (C) 2000 Bruno Coudoin
*
......@@ -153,6 +153,9 @@ static void start_board (GcomprisBoard *agcomprisBoard)
{
gcomprisBoard=agcomprisBoard;
/* disable im_context */
gcomprisBoard->disable_im_context = TRUE;
gcompris_set_background(gnome_canvas_root(gcomprisBoard->canvas), "images/scenery3_background.png");
gcomprisBoard->level = 1;
......
......@@ -186,6 +186,10 @@ static void start_board (GcomprisBoard *agcomprisBoard)
if(agcomprisBoard!=NULL)
{
gcomprisBoard=agcomprisBoard;
/* disable im_context */
gcomprisBoard->disable_im_context = TRUE;
gcomprisBoard->level=1;
gcomprisBoard->maxlevel=NUMBER_OF_TARGET;
gcomprisBoard->sublevel=1;
......
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