About private elements on gtkcalendar



Hi,

I was taking a look to the accessibility implementation for gtkcalendar:
http://bugzilla.gnome.org/show_bug.cgi?id=321123

I have asked some questions there and on gnome-accessibility list, but
as it is related to a gtk widget I will ask for help on this list too.

I model each element (ie: days, day names, week numbers, ...) as
individual cells (flyweight objects, new atk objects). My current
problem is implement the complete AtkComponent interface. 

The calendar has some gdkwindows to draw itself, and each indivual
element is drawed internally. Finally I was able to identify each
internal gdk window using some positioning heuristic, but the problem is
that I don't have access to the private position variables used to draw
each element. For example, this code computes the day with:

  priv->day_width = (priv->min_day_width
  		     * ((allocation->width - (xthickness + INNER_BORDER) * 2
		     - (CALENDAR_MARGIN * 2) -  (DAY_XSEP * 6) - CALENDAR_XSEP * 2))
		     / (7 * priv->min_day_width + priv->max_week_char_width * 2));

I suppose that I could replicate this formulaes on gailcalendar, but
basically I'm talking about a copy&paste, and this can envolve sync
problems. There are a lot of formulaes and constants, so any change on
gtkcalendar can outdate gailcalendar. And... well, I don't like the idea
to have exactly the same code in different places ;)

But in fact, probably this data has sense to be private, as it is used
in very concrete points.

Any idea, thought, opinion or hint about it?

Thanks

PD: at this moment Im using an aproximation, "supposing" that the cell
have the same size and cover the whole gdkwindow. But it isn't a good
idea anyway.


-- 
API <apinheiro igalia com>


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