I just want to be able to set the area designation to be not only a bedroom, but also a study, dining room, and/or tomb.
That would be good. I'm not sure how you'd tell the difference between a study and a dining room though. New furniture perhaps? A cupboard or something to make it a dining room?
Not being necessarily an advocate for this system, but certainly playing around with the idea enough in my head, I envisage that
either the zone is "Dining Room", and thus any contiguous area within the DR-zone (note, I was on the same lines as you...
) becomes a dining room as soon as it is made so, or if it's a generic room (or, as zones can be multi-type, e.g. meeting area/fishing zone/water zone/pasture, all at once) then I might imagine that the first item sets the role, and/or a subsequent different-type furniture gives a pop-up/menuised option to become the "head item".
i.e. in a room in the "room" zone with a chair is initially a meeting room (you may be able to de-designate, as per doors being internal or not as far as natural room boundaries are concerned), placing a table gives an option to become a dining room, placing an armour stand gives an option to become a barracks/muster area, placing a statue gives an option to become a statue park. But maybe you, as the player, still intend it to be your mayoral office and are just jazzing it up with some of the required or room-buffing items you want to put into it.
To that extent, how about the time you want to replace the basic, no-quality wooden bed in your Baron's suite with the moodcrafted bluemetal bedstead studded with diamond, hung with rings of electrum and spikes of sea-monster leather? Currently, I might have to decide whether I want it in the same place as before, perhaps deprive the noble of a working bed for a while while the first is deconstructed until the new one is built in its place then re-create the from-the-furniture room designation. Or put it to one side, de-designate and re-designate once the second is built, allowing the first to be deconstructed (if needed elsewhere) without the risk the baron claims J Future Peasant-Migrant's intended bedroom just by sleeping in it, and causing problems (never mind the possibility of mandates through not being satisfied in the bedroom department... *fnar fnar*).
But how about placing a second bed in an existing (bed)room zone? Either by pop-up or by examining the room properties you could set that bed to be the new 'main' furniture item with no discontinuity of room itself (thus any and all aspects of configuration are retained easily, including military unit associations in the case of armour stand/weapon rack rooms). If you were happy to have the new bed elsewhere than the first, then it's a virtually one-step process. If you're all OCD about it, you build a temporary new bed to 'take over' then set moodcrafted one over the original location to take control back again so you can free up the temporary one as well.
You would also need to monitor changes within the zone. If new furniture is built in a room you decide its type again. If a tile is mined you check what rooms it is adjacent to. If one room then that room is extended, if two or more then they are merged and their function decided again. If a wall or fortification is built you'd need to check if a room has been split.
I'd say that you wouldn't have it happen dynamically.
We're all used to bedrooms and how placing one somewhere where a large room size would spill out into a corridor while trying to make fill the corners of a room it will eventually be enclosed within. You can set Any Old Door
TM in the doorway, however, set the room size and spread based upon that potential door and then de-designate that AOD's construction, and the room is still the same size. (Whether or not you intend to later fill the door with your as-yet-unmade mastwork marble doorway.) Also, if if you dig more room out, or otherwise adjust the 'natural' boundaries, you do need to manually re-size, and I can't see it being better to be done more dynamically and real-time.
As I say though, I'm only a dabbling programmer so I might be missing some big problem with all this.
Regardless of my level of programming (dabbling or otherwise) I think the bigger stumbling block involved is that we don't know how Toady's code is (dis-)organised. I always try to make practical suggestions along the lines of "well, there's code for <foo> which we can re-use", but I have no way of knowing if there's any code-re-use that can be done at all. (Worst case scenario, the
idea behind the inspirationally-equivalent process can be re-used, but has to be totally re-written to work with the different data-structures involved in the new scenario.) I don't think that what you've said is impossible (as, of course, with my own utterances on the subject), but it may be awkward or just not mesh with the actuality.