[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:

GtkContainer:
	Add -> Added
	Remove -> Removed
	SetFocusChild -> FocusChildSet
GtkEditable:
	DeleteText -> TextDeleted
	InsertText -> TextInserted
GtkEntry:
	CopyClipboard -> ClipboardCopied
	CutClipboard -> ClipboardCut
	PasteClipboard -> ClipboardPasted
GtkItem:
	Deselect -> Deselected
	Select -> Selected
	Toggle -> Toggled
GtkList:
	SelectChild -> ChildSelected
	UnselectChild -> ChildUnselected
GtkOldEditable:
	CopyClipboard -> ClipboardCopied
	CutClipboard -> ClipboardCut
	PasteClipboard -> ClipboardPasted
GtkTextBuffer:
	ApplyTag -> TagApplied
	InsertChildAnchor -> ChildAnchorInserted
	InsertPixbuf -> PixbufInserted
	RemoveChildAnchor -> ChildAnchorRemoved
	RemoveTag -> TagRemoved
GtkTipsQuery:
	StartQuery -> QueryStarted
	StopQuery -> QueryStopped
GtkTree:
	SelectChild -> ChildSelected
	UnselectChild -> ChildUnselected
GtkTreeItem:
	Collapse -> Collapsed
	Expand -> Expanded
GtkWidget:
	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