MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   iRex (https://www.mobileread.com/forums/forumdisplay.php?f=99)
-   -   Leafpad Text editor (https://www.mobileread.com/forums/showthread.php?t=38677)

allovertheglobe 02-11-2009 11:47 PM

Leafpad Text editor
 
This may have flown a bit under the radar, but in light of the dearth of DR1000 apps (*) at this point:

UtterInanity has posted a port of the Leafpad text editor in the iRex DR1000 Developer forum! It has optional line numbering, word wrap etc., and UtterInanity has already adressed a couple of issues. I think this is a useful addition, an din part the reason for my renewed request for a visually improved on-screen keyboard.

(*) Of course, the ones that are available (like FBReader and now Leafpad) are very worthwhile!

Mackx 04-12-2009 01:27 PM

1 Attachment(s)
(I wanted to react on the iRex forum, but they do not allow attachements, so I post it here)

I finally had some time to add an icon to the toolbar when running leafpad. This allows you to switch to other programs and switch back to leafpad again.
I had some problems with the makefiles (autoreconf to be more specific), so I modified the Makefile directly... (If someone knows how to fix this please let me know.)

I reused a small part of the ipc.c file from helloworld to signal that the app has started. This will add the icon in the taskbar and allow you to switch back to leafpad. (I had to include the ipc.c file in main.c because of the problems with autoreconf that I had.)
(If you want to test the new code on the emulator, be sure to start the application from UDS, so via a .desktop-file, otherwise the icon will not show up)

Since the patched code with the 'Close Keyboard'-button is not published, I publish my change and hope that UtterInanity will add these changes to his version with the button.

The attached file contains the added ipc.c and ipc.h, the manually changed src/Makefile and the modified main.c. The same trick can also be applied to other programs that are ported to the DR.
I also included the build leafpad application, but be carefull, this is without the Close Keyboard patch.

UtterInanity 04-13-2009 10:47 PM

Unfortunately, I managed to completely botch my VMWare environment to the point where it won't even boot any more. This means I can't get to the patch any more. However, it was literally one (maybe two) lines of code. Something like GtkButton* closeKeyboard = gtk_button_new_with_label("Close Keyboard"); but don't quote me on that.

And then I just stuck it in after the text box. It doesn't actually do anything, there's no other code linked to it. I might try adding it in again, if I get around to downloading the VMWare image again (or fixing the one I have... anybody know how to boot to the terminal? It's actually just the XServer that's screwed up.)

Mackx 04-14-2009 03:34 AM

Quote:

Originally Posted by UtterInanity (Post 427395)
Unfortunately, I managed to completely botch my VMWare environment to the point where it won't even boot any more. This means I can't get to the patch any more. However, it was literally one (maybe two) lines of code. Something like GtkButton* closeKeyboard = gtk_button_new_with_label("Close Keyboard"); but don't quote me on that.

You probably also warn people to make regular backups, but like me, don't make them yourself ... :-(
Anyway, I did something simular as you described with the button, and (as I described in an other thread) when you give is focus when closing the app (i.e. call gtk_widget_grab_focus() in on_file_quit()-function) the keyboard will close automatically. It is still a little clumsy, but at least you can not forget to close the keyboard. I will see if I can find some time to do the change and post it here.

Cliffe 04-21-2009 02:21 PM

I added Leafpad to the DR software wiki:
https://wiki.mobileread.com/wiki/Digital_Reader_Software

Mackx 04-22-2009 04:04 PM

1 Attachment(s)
Quote:

Originally Posted by Mackx (Post 427510)
I will see if I can find some time to do the change and post it here.

I found some time. Follow the original installation instructions, but then copy the new version of leafpad to your SD card. When you already have the old version, just copy over the old (or rename the old first :-)

Two enhancements compared to the pervious port:
1) An icon is now shown in the Task Manager of the DR menu.
2) The keybord is now removed when closing the program

Mackx 07-25-2009 10:56 AM

New file dialog
 
1 Attachment(s)
I am not sure how much this program is used, but I recompiled it so that it now uses gtk_file_selection i.s.o. gtk_file_chooser. Two advantages, the dialog is much bigger and it allows you to create directories, which is usefull for 'this kind of' editors.
Note that this is a dangerous tool and you should not start editing system files!!
Unzip file on your SD card.

owl123 07-25-2009 05:11 PM

Great job. Thanks, Mackx!

GEMITO138 07-26-2009 05:41 AM

Many thanks!!!


All times are GMT -4. The time now is 06:35 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.