david gowers <neota@xxxxxxxxxxxx> writes: > kevin: > you misunderstood. > it makes sense to store the Palettes as a list.. but not the contents of the > palettes. what i meant was that each GimpPalette has a GList of > GimpPaletteEntries. > > GArray-based allocation would be one way to optimize memory allocation, which > is currently unnecessarily inefficient(2 mallocs per each palette entry?!.) > and slows the palette editing down significantly for large palettes (>256). > it may be able to eliminate the 'position' attribute for each palette entry, > which as noted in gimppalette.h is EEK*. > > next best would be allocating the GimpPaletteEntries using a GMemChunk while > ordering them using the current GList arrangements. > this appears straightforward and i could probably make a patch for it easily. > > * and appears to be because there is a widget for each color in the gimp > palette editor, rather than a single widget for the entire grid. which i > don't see a good rationale for either. maybe its just a hack that avoids > having to calculate which color was clicked on using the realized widget > dimensions. It appears you didn't even look at the code before claiming that each palette color has its own widget. ciao, --mitch