define-enum carries duplicate nice names



hi all,

while implementing the new gluecode generator, i just came
accross the following problem.
on parsing enum definitions i encountered that quite a lot of
the enum value "nice_name"s used for scheme code are duplicates e.g.:

(define-enum GtkTroughType gtk
  (none GTK_TROUGH_NONE)
  (start GTK_TROUGH_START)
  (end GTK_TROUGH_END))

(define-enum GtkPackType gtk
  (start GTK_PACK_START)
  (end GTK_PACK_END))

here, `start' and `end' are identical. i know that for scheme code
it is sufficient to have uniqueness of the enum value names only within
specific types, but does this apply to all possible applications for
enum value nice names?

also numeric characters in the first position of identifiers could
cause problems with languages other than scheme, as in:

(define-enum GdkEventType gdk
  (nothing GDK_NOTHING)
  .
  .
  (2button-press GDK_2BUTTON_PRESS)
  (3button-press GDK_3BUTTON_PRESS)
  .
  .
  (other-event GDK_OTHER_EVENT))

with a few lines extra codes i managed to still scan these identifiers
besides ordinary numbers, but again, shouldn't we behave a little bit
more resctrictive to honour every possible use (and languages besides
scheme)?


here goes a comprehensive list of duplicate nice_names for enumeration values:

$ gluegen gtk+new.defs gtk+-enums.defs
gluegen: reading `gtk+new.defs'...
gluegen: reading `gtk+-enums.defs'...

** WARNING **: duplicate creation of enum value `up' alias (GTK_ARROW_UP) for GtkArrowType requested, `up' alias (GTK_DIR_UP) already exists for GtkDirectionType

** WARNING **: duplicate creation of enum value `down' alias (GTK_ARROW_DOWN) for GtkArrowType requested, `down' alias (GTK_DIR_DOWN) already exists for GtkDirectionType

** WARNING **: duplicate creation of enum value `left' alias (GTK_ARROW_LEFT) for GtkArrowType requested, `left' alias (GTK_DIR_LEFT) already exists for GtkDirectionType

** WARNING **: duplicate creation of enum value `right' alias (GTK_ARROW_RIGHT) for GtkArrowType requested, `right' alias (GTK_DIR_RIGHT) already exists for GtkDirectionType

** WARNING **: duplicate creation of enum value `none' alias (GTK_WIN_POS_NONE) for GtkWindowPosition requested, `none' alias (GTK_SHADOW_NONE) already exists for GtkShadowType

** WARNING **: duplicate creation of enum value `left' alias (GTK_DIRECTION_LEFT) for GtkSubmenuDirection requested, `left' alias (GTK_DIR_LEFT) already exists for GtkDirectionType

** WARNING **: duplicate creation of enum value `right' alias (GTK_DIRECTION_RIGHT) for GtkSubmenuDirection requested, `right' alias (GTK_DIR_RIGHT) already exists for GtkDirectionType

** WARNING **: duplicate creation of enum value `none' alias (GTK_SCROLL_NONE) for GtkScrollType requested, `none' alias (GTK_SHADOW_NONE) already exists for GtkShadowType

** WARNING **: duplicate creation of enum value `none' alias (GTK_TROUGH_NONE) for GtkTroughType requested, `none' alias (GTK_SHADOW_NONE) already exists for GtkShadowType

** WARNING **: duplicate creation of enum value `start' alias (GTK_TROUGH_START) for GtkTroughType requested, `start' alias (GTK_PACK_START) already exists for GtkPackType

** WARNING **: duplicate creation of enum value `end' alias (GTK_TROUGH_END) for GtkTroughType requested, `end' alias (GTK_PACK_END) already exists for GtkPackType

** WARNING **: duplicate creation of enum value `left' alias (GTK_POS_LEFT) for GtkPositionType requested, `left' alias (GTK_DIR_LEFT) already exists for GtkDirectionType

** WARNING **: duplicate creation of enum value `right' alias (GTK_POS_RIGHT) for GtkPositionType requested, `right' alias (GTK_DIR_RIGHT) already exists for GtkDirectionType

** WARNING **: duplicate creation of enum value `none' alias (GTK_TYPE_NONE) for GtkFundamentalType requested, `none' alias (GTK_SHADOW_NONE) already exists for GtkShadowType

** WARNING **: duplicate creation of enum value `left' alias (GTK_JUSTIFY_LEFT) for GtkJustification requested, `left' alias (GTK_DIR_LEFT) already exists for GtkDirectionType

** WARNING **: duplicate creation of enum value `right' alias (GTK_JUSTIFY_RIGHT) for GtkJustification requested, `right' alias (GTK_DIR_RIGHT) already exists for GtkDirectionType

** WARNING **: duplicate creation of enum value `center' alias (GTK_JUSTIFY_CENTER) for GtkJustification requested, `center' alias (GTK_WIN_POS_CENTER) already exists for GtkWindowPosition

** WARNING **: duplicate creation of enum value `fill' alias (GTK_JUSTIFY_FILL) for GtkJustification requested, `fill' alias (GTK_FILL) already exists for GtkAttachOptions

** WARNING **: duplicate creation of enum value `toplevel' alias (GDK_WINDOW_TOPLEVEL) for GdkWindowType requested, `toplevel' alias (GTK_WINDOW_TOPLEVEL) already exists for GtkWindowType

** WARNING **: duplicate creation of enum value `dialog' alias (GDK_WINDOW_DIALOG) for GdkWindowType requested, `dialog' alias (GTK_WINDOW_DIALOG) already exists for GtkWindowType

** WARNING **: duplicate creation of enum value `normal' alias (GDK_IMAGE_NORMAL) for GdkImageType requested, `normal' alias (GTK_STATE_NORMAL) already exists for GtkStateType

** WARNING **: duplicate creation of enum value `grayscale' alias (GDK_VISUAL_GRAYSCALE) for GdkVisualType requested, `grayscale' alias (GTK_PREVIEW_GRAYSCALE) already exists for GtkPreviewType

** WARNING **: duplicate creation of enum value `solid' alias (GDK_LINE_SOLID) for GdkLineStyle requested, `solid' alias (GDK_SOLID) already exists for GdkFill

** WARNING **: duplicate creation of enum value `round' alias (GDK_JOIN_ROUND) for GdkJoinStyle requested, `round' alias (GDK_CAP_ROUND) already exists for GdkCapStyle

** WARNING **: duplicate creation of enum value `cursor' alias (GDK_LAST_CURSOR) for GdkCursorType requested, `cursor' alias (GDK_WA_CURSOR) already exists for GdkWindowAttributesType

** WARNING **: duplicate creation of enum value `fill' alias (GDK_GC_FILL) for GdkGCValuesMask requested, `fill' alias (GTK_FILL) already exists for GtkAttachOptions

** WARNING **: duplicate creation of enum value `delete' alias (GDK_PROPERTY_DELETE) for GdkPropertyState requested, `delete' alias (GDK_DELETE) already exists for GdkEventType


---
ciaoTJ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]