Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-01-2013, 02:52 AM   #1
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
Simon Tatham's Puzzles

as mentioned by geekmaster (https://www.mobileread.com/forums/sho...am#post2144637 ), these are some neat little puzzles.

Source is here: http://www.chiark.greenend.org.uk/~sgtatham/puzzles/

I would like them to look like this: https://play.google.com/store/apps/d...ris.sgtpuzzles
specifically, the Solo (sudoku) app with a numberpad, and Net with the choice of rotate left or rotate right buttons. Other apps run ok as is with title hacks in gtk.c

My current issue: I can see with "xwininfo -tree -root" that solo is showing and so is a keyboard in the background. Is there a simple way to fix the title to show the program with -geometry 600x600+0+0 like from here:
https://www.mobileread.com/forums/sho...6&postcount=13 post 13?
On my current firmware 5.3.7, that xev statement doesn't seem to work for me? I can't figure a way to show the program TopLevel window and the keyboard at the same time? This is all GTK stuff, and I have found some pointers from: https://github.com/chrisboyle/sgtpuzzles as this is the Android port from above. He adds many "#ifdef ANDROID" statements.

So the question again, where can I get more info on title hacking other than the thread above? I tried reading some lua scripts but got lost..

EDIT: in gtk.c there is a section with a flag for REQUIRE_NUMPAD - maybe I can change it from popping up a keyboard to having a number toolbar - we'll see...

Last edited by twobob; 11-01-2013 at 09:24 PM. Reason: post 13
brianinmaine is offline   Reply With Quote
Old 11-01-2013, 10:04 PM   #2
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
sucks huh.

I would look at the way baf wrapped up kterm.

shove this in the top bit.
The keyboard in the bottom bit.

I read the entire http://www.chiark.greenend.org.uk/~s...l/drawing.html

The kterm solution would be the tidiest IMHO
twobob is offline   Reply With Quote
Advert
Old 11-03-2013, 05:33 PM   #3
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
heres a few pulles that work without modification (much). I'm still trying to lean the gtk stuff so I can hopefully get solo (the sudoku game) working. WIP but these 3 seem fine.

enjoy!
Attached Files
File Type: zip puzzles.zip (476.5 KB, 119 views)
brianinmaine is offline   Reply With Quote
Old 11-03-2013, 05:40 PM   #4
Aeris
Developer's Corner Mascot
Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.Aeris ought to be getting tired of karma fortunes by now.
 
Aeris's Avatar
 
Posts: 486
Karma: 1277790
Join Date: Sep 2013
Device: Kindle Paperwhite 5.3.4, Kindle Keyboard 3.4
Great work brianinmaine! They all work perfectly on Kindle PW
Aeris is offline   Reply With Quote
Old 11-04-2013, 08:29 AM   #5
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
3 down.. 33 to go..
the android port has got 34..
maybe going through the android port's code could help you..? (https://github.com/chrisboyle/sgtpuzzles/)

Last edited by nasser; 11-04-2013 at 08:36 AM.
nasser is offline   Reply With Quote
Advert
Old 11-04-2013, 10:33 AM   #6
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
and more specifically this commit

https://github.com/chrisboyle/sgtpuz...c25738cfe0b126

which is the first "final" commit from about 4 years ago and /probably/ contains most of the major changes required to make it go the new platform.


It should be noted that in fact this cited work is more about adding java support than tweaking the gtk guts. so... not necessarily actually any help...



Note the following link will /probably/ become out of date if new commits are applied...
https://github.com/chrisboyle/sgtpuz...master?page=14
(however it's been a year since the last commit so... should be okay)

Last edited by twobob; 11-04-2013 at 10:36 AM.
twobob is offline   Reply With Quote
Old 11-04-2013, 11:23 PM   #7
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
The part that confuses me the most at the moment:
say I select 'pegs' as the puzzle, then in the game menu, select 'Specific...' it pops up the built-in keyboard!
I don't know anything about gtk so this is all VERY confusing to me. Apparently the game 'solo' has a pencil-in mode and a regular add number mode. With a touch screen, I would be satisfied if touching a square popped up the keyboard, allowing input of a number. Not pretty, but functional at least. bafs way of including a keyboard (matchbox) is way beyond my abilites still. I can kind of read the code in kterm, but I can't just cut and paste it into here and make it work. I know it requires a lot more work than that - maybe a LONG time of learning about gtk.
In the meantime, there are a few other playable puzzles, which I shall try to include, but many require a right click or have many colors to play correctly and would not work well on a Kindle. If anyone else wants a go, I'd be happy to post a diff of where I'm at

A part of gtk.c
Code:
#ifdef STYLUS_BASED
    menuitem=gtk_button_new_with_mnemonic("_Redo");
    gtk_object_set_data(GTK_OBJECT(menuitem), "user-data",
			GINT_TO_POINTER((int)('r')));
    gtk_signal_connect(GTK_OBJECT(menuitem), "clicked",
		       GTK_SIGNAL_FUNC(menu_key_event), fe);
    gtk_box_pack_end(hbox, menuitem, FALSE, FALSE, 0);
    gtk_widget_show(menuitem);

    menuitem=gtk_button_new_with_mnemonic("_Undo");
    gtk_object_set_data(GTK_OBJECT(menuitem), "user-data",
			GINT_TO_POINTER((int)('u')));
    gtk_signal_connect(GTK_OBJECT(menuitem), "clicked",
		       GTK_SIGNAL_FUNC(menu_key_event), fe);
    gtk_box_pack_end(hbox, menuitem, FALSE, FALSE, 0);
    gtk_widget_show(menuitem);

    if (thegame.flags & REQUIRE_NUMPAD) {
	hbox = GTK_BOX(gtk_hbox_new(FALSE, 0));
	gtk_box_pack_start(vbox, GTK_WIDGET(hbox), FALSE, FALSE, 0);
	gtk_widget_show(GTK_WIDGET(hbox));

	*((int*)errbuf)=0;
	errbuf[1]='\0';
	for(errbuf[0]='0';errbuf[0]<='9';errbuf[0]++) {
	    menuitem=gtk_button_new_with_label(errbuf);
	    gtk_object_set_data(GTK_OBJECT(menuitem), "user-data",
				GINT_TO_POINTER((int)(errbuf[0])));
	    gtk_signal_connect(GTK_OBJECT(menuitem), "clicked",
			       GTK_SIGNAL_FUNC(menu_key_event), fe);
	    gtk_box_pack_start(hbox, menuitem, TRUE, TRUE, 0);
	    gtk_widget_show(menuitem);
	}
    }
#endif /* STYLUS_BASED */
my goal is in the REQUIRE_NUMPAD section to show a toolbar. then I could possibly add number buttons as toolbar buttons. By adding it to just this section, it wouln't show on the wrong games. Maybe even a few other buttons for left-click and right-click for games like 'net'.

I have tried adding code (copy/paste from other websites) to this section but I can't seem to get a handle on which boxes are within which... Maybe I'll try to find a gtk forum and ask there.

Last edited by brianinmaine; 11-05-2013 at 01:12 AM.
brianinmaine is offline   Reply With Quote
Old 11-05-2013, 01:28 AM   #8
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
here are all the puzzles and a diff of gtk.c -> many will not be playable, but to try them out, ssh in and in the bin directory run "runit.sh gamename" so you can kill it if it doesn't work. If you want, add it to the KUAL menu.json file.

I'll probably keep playing on and off, maybe someday...
Attached Files
File Type: zip puzzles.zip (5.62 MB, 112 views)
File Type: txt gtk.c.patch.txt (5.3 KB, 132 views)
brianinmaine is offline   Reply With Quote
Old 11-05-2013, 05:11 AM   #9
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
it's because you are setting:

GTK_IM_MODULE=kindle

If I had to guess.

Try it with and without to see the differences. Basically /with/ will in certain circumstances invoke the internal keyboard, and /without/ never will.

Last edited by twobob; 11-05-2013 at 05:16 AM.
twobob is offline   Reply With Quote
Old 11-05-2013, 05:51 AM   #10
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
Shucks - that didn't work for me either. Oh well. I tried all night with all kinds of toolbar stuff and can't even make it display anything. No big deal, it's only puzzles, right? Just learning..
brianinmaine is offline   Reply With Quote
Old 11-05-2013, 06:16 AM   #11
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
yeah. this is a pretty complicated project, but with a bit of love can probably me made to serve... If I HAD to guess - shove the stuff on the D layer with the RKB:true flag and turn off the GTK_IM_MODULE=kindle

Then invoke the keyboard manually using the toggleKeyboard script that I shoved in various projects.. I'll have a look in a bit then
twobob is offline   Reply With Quote
Old 11-05-2013, 06:20 AM   #12
brianinmaine
Evangelist
brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.brianinmaine ought to be getting tired of karma fortunes by now.
 
brianinmaine's Avatar
 
Posts: 456
Karma: 1287375
Join Date: Jan 2013
Location: West Gardiner, Maine
Device: Touch (5.3.7)
no biggie, like I said. I just love sudoku and was trying this to get it. ever since chris_c and his gtksudoku version stopped working.. too bad we didn't get a patch file of his project!
brianinmaine is offline   Reply With Quote
Old 11-05-2013, 06:32 AM   #13
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
right. I was /pretty/ sure that hawhill had done a sudoku so I didn't bother to look for one...

Hmm...
twobob is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Short Fiction Collins, Simon: Short Stories by Simon Collins. V1. 13 Sep 2012 crutledge Kindle Books (offline) 0 09-13-2012 08:07 AM
Short Fiction Collins, Simon: Short Stories by Simon Collins. V1. 13 Sep 2012 crutledge ePub Books (offline) 0 09-13-2012 08:05 AM
Short Fiction Collins, Simon: Short Stories by Simon Collins. V1. 13 Sep 2012| crutledge BBeB/LRF Books (offline) 0 09-13-2012 08:03 AM
puzzles fogel Introduce Yourself 9 08-27-2010 10:00 AM
Crossword Puzzles Louisk iRex 3 08-22-2007 04:34 AM


All times are GMT -4. The time now is 01:35 AM.


MobileRead.com is a privately owned, operated and funded community.