[Gtk-sharp-list] Naming conventions: a suggestion.

Rachel Hestilow hestilow@ximian.com
21 Jun 2002 05:02:52 -0500

On Thu, 2002-06-20 at 23:18, Mike Kestner wrote:
> I am trying to decide whether to resolve these collisions when
> generating XML, or in the code generator.  I'm inclined to do it in the
> XML production, because then any other OO languages that choose to reuse
> the XML will not need to work around it in their code generators.

In the course of hacking tonight I had to add a "rename" directive to
the metadata parser, and it occured to me I could easily use this to fix
the signal collisions. I grepped through the generated source and added
the following signal renames to the metadata:

	Add -> Added
	Remove -> Removed
	SetFocusChild -> FocusChildSet
	DeleteText -> TextDeleted
	InsertText -> TextInserted
	CopyClipboard -> ClipboardCopied
	CutClipboard -> ClipboardCut
	PasteClipboard -> ClipboardPasted
	Deselect -> Deselected
	Select -> Selected
	Toggle -> Toggled
	SelectChild -> ChildSelected
	UnselectChild -> ChildUnselected
	CopyClipboard -> ClipboardCopied
	CutClipboard -> ClipboardCut
	PasteClipboard -> ClipboardPasted
	ApplyTag -> TagApplied
	InsertChildAnchor -> ChildAnchorInserted
	InsertPixbuf -> PixbufInserted
	RemoveChildAnchor -> ChildAnchorRemoved
	RemoveTag -> TagRemoved
	StartQuery -> QueryStarted
	StopQuery -> QueryStopped
	SelectChild -> ChildSelected
	UnselectChild -> ChildUnselected
	Collapse -> Collapsed
	Expand -> Expanded
	GrabFocus -> FocusGrabbed
	Hide -> Hidden
	Map -> Mapped
	Realize -> Realized
	Show -> Shown
	Unmap -> Unmapped
	Unrealize -> Unrealized

This rename is implemented at the XML generation level (basically a few
lines modification to Metadata.pm, and the relevant rename rule entries
in Gtk.metadata). I can commit this with the rest of my stuff tomorrow
if it looks good to you, Mike.

-- Rachel