Opened 12 years ago

Last modified 8 years ago

#9744 assigned enhancement

Greek (Extended).Keymap – Greek Polytonic keyboard

Reported by: greekboy Owned by: nobody
Priority: low Milestone: Unscheduled
Component: Preferences/Keymap Version: R1/alpha4.1
Keywords: Greek Polytonic Cc:
Blocked By: Blocking: #2098
Platform: All

Description

Haiku does not support Greek Polytonic for my greek language, but Windows, Linux and MacOS can. A long time ago I started my own project for Haiku in order to support Greek Polytonic keyboard. My source code increased the 5 dead-keys up to 32 dead-keys and also each dead key array can contain up to 19 pairs of dead key characters. Of course it does not break compatibility.

The project is finished and I have attached my patches. If you accept my patches, please also close the other ticket:

https://dev.haiku-os.org/ticket/2098#

Here is the video showing the possibilities.

http://www.youtube.com/watch?v=rICUMM1gQls

Attachments (16)

Keymap.cpp.patch (52.1 KB ) - added by greekboy 12 years ago.
keymap.cpp.patch (8.6 KB ) - added by greekboy 12 years ago.
keymap.cpp.2.patch (6.6 KB ) - added by greekboy 12 years ago.
keymap.h.patch (1.4 KB ) - added by greekboy 12 years ago.
keymapWindow.cpp.patch (33.0 KB ) - added by greekboy 12 years ago.
keymapWindow.h.patch (1.6 KB ) - added by greekboy 12 years ago.
InterfaceDefs.h.patch (2.8 KB ) - added by greekboy 12 years ago.
Greek (Extended).keymap.patch (42.2 KB ) - added by greekboy 12 years ago.
0001-My-first-commit-in-the-branch.patch (52.6 KB ) - added by greekboy 11 years ago.
0002-My-2nd-commit-in-the-branch.patch (9.1 KB ) - added by greekboy 11 years ago.
0003-My-3rd-commit-in-the-branch.patch (7.1 KB ) - added by greekboy 11 years ago.
0004-My-4th-commit-in-the-branch.patch (1.7 KB ) - added by greekboy 11 years ago.
0005-My-5th-commit-in-the-branch.patch (33.4 KB ) - added by greekboy 11 years ago.
0006-My-6th-commit-in-the-branch.patch (2.2 KB ) - added by greekboy 11 years ago.
0007-My-7th-commit-in-the-branch.patch (3.1 KB ) - added by greekboy 11 years ago.
0008-My-8th-commit-in-the-branch.patch (42.5 KB ) - added by greekboy 11 years ago.

Download all attachments as: .zip

Change History (35)

by greekboy, 12 years ago

Attachment: Keymap.cpp.patch added

comment:1 by greekboy, 12 years ago

patch: 01

by greekboy, 12 years ago

Attachment: keymap.cpp.patch added

by greekboy, 12 years ago

Attachment: keymap.cpp.2.patch added

by greekboy, 12 years ago

Attachment: keymap.h.patch added

by greekboy, 12 years ago

Attachment: keymapWindow.cpp.patch added

by greekboy, 12 years ago

Attachment: keymapWindow.h.patch added

by greekboy, 12 years ago

Attachment: InterfaceDefs.h.patch added

by greekboy, 12 years ago

comment:2 by korli, 12 years ago

Hi Hristos,

thanks for the patchs. They look clean and fine though git format-patch is preferred.

Unfortunately changing the struct keymap (in InterfaceDefs.h.patch) breaks binary compatibility. I have yet no idea on how to improve the situation related to the number of dead-keys.

comment:3 by greekboy, 12 years ago

I' m not understand. What do you mean, break binary compatibility?

My source code works very well.

in reply to:  3 ; comment:4 by anevilyak, 12 years ago

Replying to greekboy:

I' m not understand. What do you mean, break binary compatibility?

The keymap structure is public. Consequently, changing its size will break existing executables that make use of it (and were compiled against the previous version). This is something we try to avoid.

in reply to:  4 comment:5 by greekboy, 12 years ago

Replying to anevilyak:

Replying to greekboy:

I' m not understand. What do you mean, break binary compatibility?

The keymap structure is public. Consequently, changing its size will break existing executables that make use of it (and were compiled against the previous version). This is something we try to avoid.

Do you talk about executables applications? See in my video. Time: 16:07 - 19:04.

Last edited 12 years ago by greekboy (previous) (diff)

comment:6 by axeld, 12 years ago

Thanks a lot for your patches, but please use git format-patch in the future.

About the binary compatibility problem: applications will not crash by your changes (since the only way to retrieve a key_map structure is via get_key_map(), and that one is safe in this regard).

However, even if we change the version of that structure, old applications using the table will use it incorrectly, as the location of things changed. You could fix this by not extending the existing arrays, but rather by adding new ones to the end of the structure. Unfortunately, this would make pretty much all changes rather messy. I also believe (but haven't checked) that you break the on-disk format of our binary keymap files -- this would not be acceptable at all.

Since we can determine whether an application has been linked against Haiku libraries, or BeOS libraries, we could also provide the new structure only for new applications. This would require a mechanism to convert the structures for old apps, though.

Do you understand what I'm trying to explain here, Hristos?

BTW, we do not add authors to the header files; it wasn't missing by accident. And if you actually have to add such a list, please fill it from its log history as a courtesy to the other authors.

comment:7 by greekboy, 12 years ago

I understand.

I have no problem if you erase my name. Just I wanted to help you.

in reply to:  6 comment:8 by greekboy, 12 years ago

Replying to axeld:

I also believe (but haven't checked) that you break the on-disk format of our binary keymap files -- this would not be acceptable at all.

See in my video. Time: 16:42 - 19:04.

in reply to:  7 ; comment:9 by axeld, 12 years ago

Replying to greekboy:

I understand.

I'm not really sure about that, actually.

I have no problem if you erase my name. Just I wanted to help you.

I guess you misunderstood: the public headers don't have an author list (InterfaceDefs.h), everything else has.

I also believe (but haven't checked) that you break the on-disk format of our binary keymap files -- this would not be acceptable at all.

See in my video. Time: 16:42 - 19:04.

First of all, it's unreasonable to have to watch a video for this. Please just answer in plain text instead. Also, that video doesn't show that. While the text format looks similar, the binary format may not. Can't you just answer for real, and show me why it does not break the binary format compatibility?

We'd really like to include this functionality into Haiku, and appreciate your effort. However, in the current form, we cannot accept your patch, unfortunately.

in reply to:  9 comment:10 by greekboy, 12 years ago

Replying to axeld:

First of all, it's unreasonable to have to watch a video for this. Please just answer in plain text instead. Also, that video doesn't show that. While the text format looks similar, the binary format may not. Can't you just answer for real, and show me why it does not break the binary format compatibility?

I can't answer for binary format compatibility.

You could fix this by not extending the existing arrays, but rather by adding new ones to the end of the structure.

You mean like this?

int32 acute_dead_key[38]; int32 grave_dead_key[38]; int32 circumflex_dead_key[38]; int32 dieresis_dead_key[38]; int32 tilde_dead_key[38]; int32 acutesmooth_dead_key[38]; int32 acuterough_dead_key[38]; int32 acutediaeresis_dead_key[38]; int32 acutesubscript_dead_key[38]; int32 acutesmoothsubscript_dead_key[38]; int32 acuteroughsubscript_dead_key[38]; int32 gravesmooth_dead_key[38]; int32 graverough_dead_key[38]; int32 gravediaeresis_dead_key[38]; int32 gravesubscript_dead_key[38]; int32 gravesmoothsubscript_dead_key[38]; int32 graveroughsubscript_dead_key[38]; int32 smooth_dead_key[38]; int32 smoothcircumflex_dead_key[38]; int32 smoothsubscript_dead_key[38]; int32 smoothcircumflexsubscript_dead_key[38]; int32 rough_dead_key[38]; int32 roughcircumflex_dead_key[38]; int32 roughsubscript_dead_key[38]; int32 roughcircumflexsubscript_dead_key[38]; int32 circumflexdiaeresis_dead_key[38]; int32 circumflexsubscript_dead_key[38]; int32 diaeresisaccent_dead_key[38]; int32 accent_dead_key[38]; int32 macron_dead_key[38]; int32 breve_dead_key[38]; int32 subscript_dead_key[38];

Also I' ll use git format-patch.

Give me a few days.

comment:11 by greekboy, 11 years ago

The files are in git format-patch. The source code is the same, its structure shouldn’t change (the sequence of the dead keys) and also don’t rename the dead-keys, because the patches won’t function properly. Also I deleted my name from the file header InterfaceDefs.h. Try it and if you want it, you can use it.

Take care. The Lord bless you.

Last edited 11 years ago by greekboy (previous) (diff)

comment:12 by X512, 11 years ago

Hardcoding Greek language-specific fields is not a good idea. It's better to extend key_map in more general way such as unlimited number of dead keys and affected symbols.

in reply to:  13 comment:14 by X512, 11 years ago

Replying to greekboy:

My source code is 100% compatible with Greek Polytonic System in Windows.

Nobody says that it is not. Haiku does not try to be Windows-compatible in any way. Your solution is specific for Greek language and nothing more. Language-specific info should be stored in keymap file and not hardcoded in key_map structure.

Possible solution can be:

struct key_map_ex {
	uint32	version;
	uint32	caps_key;
	uint32	scroll_key;
	uint32	num_key;
	uint32	left_shift_key;
	uint32	right_shift_key;
	uint32	left_command_key;
	uint32	right_command_key;
	uint32	left_control_key;
	uint32	right_control_key;
	uint32	left_option_key;
	uint32	right_option_key;
	uint32	menu_key;
	uint32	lock_settings;
	int32	control_map[128];
	int32	option_caps_shift_map[128];
	int32	option_caps_map[128];
	int32	option_shift_map[128];
	int32	option_map[128];
	int32	caps_shift_map[128];
	int32	caps_map[128];
	int32	shift_map[128];
	int32	normal_map[128];
	uint32	dead_key_count;
	struct {
		int32 chars;
		uint32 tables;
	} dead_keys[1];
};

void	get_key_map_ex(uint32 version, key_map_ex** _map, char** _keyBuffer);

This extension is universal and don't break binary compatability. Also it add ability of future extentions.

Another solution can be adding dead_key_count and dead_keys to the end of current key_map structure and don't use "ex" versions. dead_key_count will be set to 0 if predefined dead keys is enougth.

Last edited 11 years ago by X512 (previous) (diff)

comment:15 by mmadia, 11 years ago

Priority: highnormal

comment:16 by pulkomandy, 10 years ago

Blocking: 2098 added

comment:17 by pulkomandy, 8 years ago

Milestone: R1Unscheduled
Priority: normallow

I have marked the patches as obsolete for the reasons mentionned above. If I understand things correctly, this is not needed to type "modern" greek. I would suggest writing a dedicated input method rather than extending the keymap system in such non-compatible way.

comment:19 by axeld, 8 years ago

Owner: changed from axeld to nobody
Status: newassigned
Note: See TracTickets for help on using tickets.