Code Monkey home page Code Monkey logo

t4kcommon's Introduction

Tux4Kids - Open source education software for children

About Tux4Kids

Tux4Kids is an international group of volunteers developing high-quality software for kids, with the goal of combining fun and learning into an irresistable package.

Our software is free: you can download it for use at home or onto hundreds of computers in a school. We support all major platforms, including Windows, Macintosh, and Linux/Unix. Our programs are used by people around the globe, and they have been translated into dozens of different languages. As open-source software, these programs can be freely extended or customized, and they are supported by active communities of volunteer developers.

Whether you're a parent, a teacher, or a kid, give Tux4Kids software a try!

Main Projects

Tux Paint

Tux Paint is a drawing program for children as young as 3 years old, containing Tux the Linux penguin, many goofy sound effects, and a large assortment of prepackaged imagery and special effect tools.

Tux, of Math Command

Tux, of Math Command lets kids hone their arithmetic skills while they defend penguins from incoming comets, or offers them a chance to explore the asteroid belt with only their factoring abilities to bring them through safely!

Tux Typing

In Tux Typing, Tux the penguin is hungry, and loves to eat fish. But Tux can only catch the fish if you type the right letters in time! Can you help Tux?

Other projects

There are also a number of in-progress projects that can be found on our GitHub project page.

t4kcommon's People

Contributors

aviraldg avatar bkmgit avatar davidstuartbruce avatar frikiluser avatar h01ger avatar matlacki avatar nalin-x-linux avatar phuff avatar ryandesign avatar sasayins avatar siddharthlatest avatar wjt avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

t4kcommon's Issues

New release required

Dear Devs, I am maintaining an Operating system named Accessible-Coconut which is accessible for visually impaired persons. We have many fans from various countries, But they also need this kind of accessible games in their normal Debian based systems. So we need to debianize new Tuxtype, Tuxmath and T4K-Common followed by a release. Please do the needful.

Link 1 : https://groups.google.com/forum/#!forum/accessible-coconut
Link 2 : https://sourceforge.net/projects/accessible-coconut/

cant build: t4k_menu.c:1334:6: error: conflicting types for ‘set_font_size’; have ‘void(_Bool)’

gcc version 11.1.0 (GCC)

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -DCOMMON_DATA_PREFIX=\"/usr/share/t4k_common\" -DDEBUG -DUSE_T4K_PREFIX=1 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/librsvg-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -pthread -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/pixman-1 -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/libxml2 -lspeechd -MT t4k_main.lo -MD -MP -MF .deps/t4k_main.Tpo -c t4k_main.c -o t4k_main.o >/dev/null 2>&1
mv -f .deps/t4k_main.Tpo .deps/t4k_main.Plo
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -Wall -g -DCOMMON_DATA_PREFIX=\"/usr/share/t4k_common\" -DDEBUG -DUSE_T4K_PREFIX=1  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT   -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT  -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1  -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT  -I/usr/include/librsvg-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -pthread -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/pixman-1  -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1  -I/usr/include/libpng16  -I/usr/include/libxml2   -lspeechd -MT t4k_menu.lo -MD -MP -MF .deps/t4k_menu.Tpo -c -o t4k_menu.lo t4k_menu.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -DCOMMON_DATA_PREFIX=\"/usr/share/t4k_common\" -DDEBUG -DUSE_T4K_PREFIX=1 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/librsvg-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -pthread -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/pixman-1 -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/libxml2 -lspeechd -MT t4k_menu.lo -MD -MP -MF .deps/t4k_menu.Tpo -c t4k_menu.c  -fPIC -DPIC -o .libs/t4k_menu.o
t4k_menu.c: In function ‘menu_TranslateNode’:
t4k_menu.c:265:23: warning: assignment to ‘xmlAttr *’ {aka ‘struct _xmlAttr *’} from incompatible pointer type ‘struct _xmlNode *’ [-Wincompatible-pointer-types]
  265 |             for(child = node->children; child; child = child->next) {
      |                       ^
t4k_menu.c:267:62: warning: passing argument 1 of ‘menu_TranslateNode’ from incompatible pointer type [-Wincompatible-pointer-types]
  267 |                     tnode->submenu[i++] = menu_TranslateNode(child);
      |                                                              ^~~~~
      |                                                              |
      |                                                              xmlAttr * {aka struct _xmlAttr *}
t4k_menu.c:222:39: note: expected ‘xmlNode *’ {aka ‘struct _xmlNode *’} but argument is of type ‘xmlAttr *’ {aka ‘struct _xmlAttr *’}
  222 | MenuNode *menu_TranslateNode(xmlNode *node) {
      |                              ~~~~~~~~~^~~~
t4k_menu.c: In function ‘T4K_RunMenu’:
t4k_menu.c:458:33: warning: passing argument 1 of ‘internal_res_switch_handler’ from incompatible pointer type [-Wincompatible-pointer-types]
  458 |     internal_res_switch_handler(&T4K_PrerenderAll);
      |                                 ^~~~~~~~~~~~~~~~~
      |                                 |
      |                                 void (*)(void)
In file included from t4k_menu.c:35:
t4k_globals.h:81:52: note: expected ‘ResSwitchCallback’ {aka ‘void (*)(int,  int)’} but argument is of type ‘void (*)(void)’
   81 | void internal_res_switch_handler(ResSwitchCallback callback);
      |                                  ~~~~~~~~~~~~~~~~~~^~~~~~~~
t4k_menu.c: At top level:
t4k_menu.c:1334:6: error: conflicting types for ‘set_font_size’; have ‘void(_Bool)’
 1334 | void set_font_size(bool uniform)
      |      ^~~~~~~~~~~~~
t4k_menu.c:1335:1: note: an argument type that has a default promotion cannot match an empty parameter name list declaration
 1335 | {
      | ^
t4k_menu.c:154:17: note: previous declaration of ‘set_font_size’ with type ‘void()’
  154 | void            set_font_size();
      |                 ^~~~~~~~~~~~~
In file included from t4k_globals.h:37,
                 from t4k_menu.c:35:
t4k_common.h:248:13: warning: ‘wrapped_lines’ defined but not used [-Wunused-variable]
  248 | static char wrapped_lines[MAX_LINES][MAX_LINEWIDTH]; //!< Global buffer for wrapped lines.
      |             ^~~~~~~~~~~~~
make[3]: *** [Makefile:669: t4k_menu.lo] Error 1
make[3]: Leaving directory '/tmp/build/t4kcommon-git/src/t4k-common-arch/src'
make[2]: *** [Makefile:709: all-recursive] Error 1
make[2]: Leaving directory '/tmp/build/t4kcommon-git/src/t4k-common-arch/src'
make[1]: *** [Makefile:618: all-recursive] Error 1
make[1]: Leaving directory '/tmp/build/t4kcommon-git/src/t4k-common-arch'
make: *** [Makefile:524: all] Error 2

Is that intended? Is it a compiler version thingy?

Building without SDLPango doesn't seem to work

I've been trying (and failing) to build t4kcommon without SDLPango.

Here's what I tried (trying to follow INSTALL when possible):

Make ended with the following errors:

/usr/bin/ld: ./.libs/libt4k_common.so: undefined reference toTTF_OpenFont'
/usr/bin/ld: ./.libs/libt4k_common.so: undefined reference to TTF_CloseFont' /usr/bin/ld: ./.libs/libt4k_common.so: undefined reference to TTF_RenderUTF8_Blended'
/usr/bin/ld: ./.libs/libt4k_common.so: undefined reference to TTF_SizeUTF8' /usr/bin/ld: ./.libs/libt4k_common.so: undefined reference to TTF_GlyphMetrics'
/usr/bin/ld: ./.libs/libt4k_common.so: undefined reference to TTF_FontAscent' /usr/bin/ld: ./.libs/libt4k_common.so: undefined reference to TTF_Init'
/usr/bin/ld: ./.libs/libt4k_common.so: undefined reference to TTF_Quit'

build failure with a newer PNG library (version 1.5.0 and up according to the docs)

info_ptr is no longer defined globally. The following may fix the compile error occuring in src/t4k_loaders.c:

-               info_ptr->width = surf->w;
-               info_ptr->height = surf->h;
-               info_ptr->bit_depth = 8;
-               info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
-               info_ptr->interlace_type = 1;
-               info_ptr->valid = 0;    /* will be updated by various png_set_FOO() functions */
+               png_set_IHDR(png_ptr, info_ptr,
+                                        surf->w,
+                                        surf->h,
+                                        8, // bit_depth
+                                        PNG_COLOR_TYPE_RGB_ALPHA,
+                                        1, // interlace_type
+                                        PNG_COMPRESSION_TYPE_DEFAULT,
+                                        PNG_FILTER_TYPE_DEFAULT);

No texts in TuxMath and TuxType Arch Linux

Hi,

TuxMath does not render texts in menus nor in game. It seems a problem with SDL.

I've submitted a fix to address it here:

I am no expert in SDL: the only thing I've done is return white_letters instead of bg in T4K_BlackOutline:

t4kcommon/src/t4k_sdl.c

Lines 1444 to 1454 in f36ec17

SDL_BlitSurface(white_letters, NULL, bg, &dstrect);
SDL_FreeSurface(white_letters);
/* --- Convert to the screen format for quicker blits --- */
SDL_SetColorKey(bg, SDL_SRCCOLORKEY|SDL_RLEACCEL, color_key);
out = SDL_DisplayFormatAlpha(bg);
SDL_FreeSurface(bg);
DEBUGMSG(debug_sdl, "\nLeaving T4K_BlackOutline(): \n");
return out;

Best!!

linebreak CMakeLists on Mac

Compile definitions in src/linebreak/CMakeLists.txt seems to be without value. The following fixes makefile generation:

-set_directory_properties(PROPERTIES COMPILE_DEFINITIONS
+set_directory_properties(PROPERTIES #COMPILE_DEFINITIONS
        LOCALEDIR='\"${LOCALE_DIR}\"'           
        LOCALE_ALIAS_PATH='\"${LOCALE_DIR}\"'
        LIBDIR='\"${TOP_SRC_DIR}\"'

libspeechd.h: no such file or directory

Trying to build on Arch Linux, I get an error stating that libspeechd.h cannot be found. I have speech-dispatcher installed, and libspeechd.h is located at /usr/include/speech-dispatcher/libspeechd.h. However, even adding the exact location to my CFLAGS, the file still cannot be found, so t4kcommon fails to build. This seems to affect T least Tuxtype as well.

Undefined symbols: _libiconv _libiconv_close _libiconv_open

t4k_common 0.1.1 fails to link for me on macOS 12 in MacPorts:

/bin/sh ../libtool --tag=CC   --mode=link /usr/bin/clang -Wall -g -DCOMMON_DATA_PREFIX=\"/opt/local/share/t4k_common\" -DDEBUG -DUSE_T4K_PREFIX=1  -pipe -Os -Wno-error=implicit-function-declaration -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64 -D_THREAD_SAFE -I/opt/local/include/SDL  -D_THREAD_SAFE -I/opt/local/include/SDL -I/opt/local/include/pango-1.0 -I/opt/local/include/fribidi -I/opt/local/include/cairo -I/opt/local/include/pixman-1 -I/opt/local/include/harfbuzz -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -D_THREAD_SAFE -I/opt/local/include/SDL -I/opt/local/include/librsvg-2.0 -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/cairo -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include/libpng16 -I/opt/local/include/libxml2  -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64 -o libt4k_common.la -rpath /opt/local/lib t4k_audio.lo t4k_convert_utf.lo t4k_linewrap.lo t4k_loaders.lo t4k_main.lo t4k_menu.lo t4k_pixels.lo t4k_sdl.lo t4k_throttle.lo t4k_replacements.lo linebreak/liblinebreak.la -lm  -L/opt/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -L/opt/local/lib -lSDL_image -lSDLmain -lSDL -Wl,-framework,Cocoa -L/opt/local/lib -lSDL_mixer -lSDLmain -lSDL -Wl,-framework,Cocoa -L/opt/local/lib -lSDL_Pango -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lharfbuzz -L/opt/local/lib -lSDL_net -lSDLmain -lSDL -Wl,-framework,Cocoa -L/opt/local/lib -lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo -L/opt/local/lib -lcairo -L/opt/local/lib -lpng16 -L/opt/local/lib -lxml2
libtool: link: (cd .libs/libt4k_common.lax/liblinebreak.a && ar x "/opt/local/var/macports/build/_Volumes_Shared_macports-ports_devel_t4k_common/t4k_common/work/t4kcommon-0.1.1/src/linebreak/.libs/liblinebreak.a")
libtool: link: /usr/bin/clang -dynamiclib  -o .libs/libt4k_common.0.dylib  .libs/t4k_audio.o .libs/t4k_convert_utf.o .libs/t4k_linewrap.o .libs/t4k_loaders.o .libs/t4k_main.o .libs/t4k_menu.o .libs/t4k_pixels.o .libs/t4k_sdl.o .libs/t4k_throttle.o .libs/t4k_replacements.o   .libs/libt4k_common.lax/liblinebreak.a/width.o .libs/libt4k_common.lax/liblinebreak.a/u8-mbtouc-unsafe.o .libs/libt4k_common.lax/liblinebreak.a/u8-mbtouc.o .libs/libt4k_common.lax/liblinebreak.a/u8-uctomb-aux.o .libs/libt4k_common.lax/liblinebreak.a/u8-mbtouc-aux.o .libs/libt4k_common.lax/liblinebreak.a/u16-mbtouc-unsafe.o .libs/libt4k_common.lax/liblinebreak.a/u8-uctomb.o .libs/libt4k_common.lax/liblinebreak.a/u16-mbtouc-unsafe-aux.o .libs/libt4k_common.lax/liblinebreak.a/u16-mbtouc.o .libs/libt4k_common.lax/liblinebreak.a/u16-mbtouc-aux.o .libs/libt4k_common.lax/liblinebreak.a/u8-mbtouc-unsafe-aux.o .libs/libt4k_common.lax/liblinebreak.a/linebreak.o   -L/opt/local/lib -lSDL_image -lSDL_mixer -lSDL_Pango -lpango-1.0 -lharfbuzz -lSDL_net -lSDLmain -lSDL -lrsvg-2 -lm -lgio-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lcairo -lpng16 -lxml2  -arch x86_64 -Wl,-headerpad_max_install_names -Wl,-syslibroot -Wl,/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64 -Wl,-framework -Wl,Cocoa -Wl,-framework -Wl,Cocoa -Wl,-framework -Wl,Cocoa -Wl,-framework -Wl,Cocoa   -install_name  /opt/local/lib/libt4k_common.0.dylib -compatibility_version 1 -current_version 1.0 -Wl,-single_module
Undefined symbols for architecture x86_64:
  "_libiconv", referenced from:
      _T4K_ConvertFromUTF8 in t4k_convert_utf.o
      _T4K_ConvertToUTF8 in t4k_convert_utf.o
      _mbs_width_linebreaks in linebreak.o
  "_libiconv_close", referenced from:
      _T4K_ConvertFromUTF8 in t4k_convert_utf.o
      _T4K_ConvertToUTF8 in t4k_convert_utf.o
      _mbs_width_linebreaks in linebreak.o
  "_libiconv_open", referenced from:
      _T4K_ConvertFromUTF8 in t4k_convert_utf.o
      _T4K_ConvertToUTF8 in t4k_convert_utf.o
      _mbs_width_linebreaks in linebreak.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libt4k_common.la] Error 1

This despite the fact that the configure script has determined how to link with libiconv:

checking for iconv... yes
checking for working iconv... yes
checking how to link with libiconv... -liconv

Yet it has not actually added -liconv to the link flags. If I manually add -liconv to LDFLAGS when configuring then it does link successfully but the build system should do that itself.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.