/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* vim:expandtab:shiftwidth=8:tabstop=8: */ /* Evolution Accessibility: ea-calendar-helpers.c * * Copyright (C) 2003 Ximian, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * Author: Bolian Yin Sun Microsystem Inc., 2003 * */ #include "ea-calendar-helpers.h" #include "ea-cal-view-event.h" #include "e-day-view.h" #include "e-week-view.h" #include /** * ea_calendar_helpers_get_accessible_for * @canvas_item: the canvas item (e_text) for a event * @returns: the atk object for the canvas_item * **/ AtkObject * ea_calendar_helpers_get_accessible_for (GnomeCanvasItem *canvas_item) { AtkObject *atk_obj = NULL; GObject *g_obj; g_return_val_if_fail (E_IS_TEXT (canvas_item), NULL); g_obj = G_OBJECT (canvas_item); /* we cannot use atk_gobject_accessible_for_object here, * EaDayViewEvent/EaWeekViewEvent cannot be created by the * registered facotry of E_TEXT */ atk_obj = g_object_get_data (g_obj, "accessible-object"); if (!atk_obj) atk_obj = ea_cal_view_event_new (g_obj); return atk_obj; } /** * ea_calendar_helpers_get_view_widget_from: * @canvas_item: the canvas item (e_text) for a event * @returns: the cal view widget if exists * * Get the cal view widget contains the canvas_item. * **/ ECalView * ea_calendar_helpers_get_cal_view_from (GnomeCanvasItem *canvas_item) { GnomeCanvas *canvas; GtkWidget *view_widget = NULL; g_return_val_if_fail (canvas_item, NULL); g_return_val_if_fail (E_IS_TEXT (canvas_item), NULL); /* canvas_item is the e_text for the event */ /* canvas_item->canvas is the ECanvas for day view */ /* parent of canvas_item->canvas is the EDayView or EWeekView widget */ canvas = canvas_item->canvas; view_widget = gtk_widget_get_parent (GTK_WIDGET(canvas)); if (!view_widget || !E_IS_CAL_VIEW (view_widget)) return NULL; return E_CAL_VIEW (view_widget); } /** * ea_calendar_helpers_get_cal_view_event_from * @canvas_item: the cavas_item (e_text) for the event * @returns: the ECalViewEvent * * Get the ECalViewEvent for the canvas_item. * **/ ECalViewEvent * ea_calendar_helpers_get_cal_view_event_from (GnomeCanvasItem *canvas_item) { ECalView *cal_view; gboolean event_found; ECalViewEvent *cal_view_event; g_return_val_if_fail (E_IS_TEXT (canvas_item), NULL); cal_view = ea_calendar_helpers_get_cal_view_from (canvas_item); if (!cal_view) return NULL; if (E_IS_DAY_VIEW (cal_view)) { gint event_day, event_num; EDayViewEvent *day_view_event; EDayView *day_view = E_DAY_VIEW (cal_view); event_found = e_day_view_find_event_from_item (day_view, canvas_item, &event_day, &event_num); if (!event_found) return NULL; if (event_day == E_DAY_VIEW_LONG_EVENT) { /* a long event */ day_view_event = &g_array_index (day_view->long_events, EDayViewEvent, event_num); } else { /* a main canvas event */ day_view_event = &g_array_index (day_view->events[event_day], EDayViewEvent, event_num); } cal_view_event = (ECalViewEvent *) day_view_event; } else if (E_IS_WEEK_VIEW (cal_view)) { gint event_num, span_num; EWeekViewEvent *week_view_event; EWeekView *week_view = E_WEEK_VIEW (cal_view); event_found = e_week_view_find_event_from_item (week_view, canvas_item, &event_num, &span_num); if (!event_found) return NULL; week_view_event = &g_array_index (week_view->events, EWeekViewEvent, event_num); cal_view_event = (ECalViewEvent *)week_view_event; } else { g_assert_not_reached (); return NULL; } return cal_view_event; } ion> FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
ModeNameSize
d---------2ping178logstatsplain
-rw-r--r--Makefile8778logstatsplainblame
d---------TkTopNetFlows146logstatsplain
d---------aggregate141logstatsplain
d---------aircrack-ng141logstatsplain
d---------airport178logstatsplain
d---------angst109logstatsplain
d---------ap-utils178logstatsplain
d---------argus-clients178logstatsplain
d---------argus-monitor178logstatsplain
d---------argus178logstatsplain
d---------argus3-clients178logstatsplain
d---------argus3178logstatsplain
d---------arpalert178logstatsplain
d---------arpscan109logstatsplain
d---------arpwatch178logstatsplain
d---------arts++146logstatsplain
d---------aspathtree178logstatsplain
d---------bandwidthd178logstatsplain
d---------bgpq141logstatsplain
d---------bgpq3109logstatsplain
d---------bigsister217logstatsplain
d---------bpft217logstatsplain
d---------braa109logstatsplain
d---------bsd-airtools178logstatsplain
d---------bsnmp-jails109logstatsplain
d---------bsnmp-regex109logstatsplain
d---------bsnmp-ucd146logstatsplain
d---------bsnmptools109logstatsplain
d---------bwm-ng109logstatsplain
d---------cacti-spine146logstatsplain
d---------cacti178logstatsplain
d---------cdpd141logstatsplain
d---------cdpr178logstatsplain
d---------cflowd178logstatsplain
d---------check_logfiles146logstatsplain
d---------check_multi146logstatsplain
d---------check_mysql_health109logstatsplain
d---------check_snmp_pkgvuln146logstatsplain
d---------chillispot178logstatsplain
d---------choparp141logstatsplain
d---------cidr141logstatsplain
d---------circe146logstatsplain
d---------cisco_conf146logstatsplain
d---------ciscoconf146logstatsplain
d---------clog178logstatsplain
d---------cnagios178logstatsplain
d---------collectd178logstatsplain
d---------collectd5178logstatsplain
d---------confregdecode178logstatsplain
d---------coovachilli217logstatsplain
d---------cowpatty141logstatsplain
d---------cricket178logstatsplain
d---------darkstat141logstatsplain
d---------dhcdrop109logstatsplain
d---------disco109logstatsplain
d---------docsis178logstatsplain
d---------driftnet141logstatsplain
d---------echolot109logstatsplain
d---------ehnt141logstatsplain
d---------etherape178logstatsplain
d---------ettercap178logstatsplain
d---------ezradius146logstatsplain
d---------fetchconfig178logstatsplain
d---------flow-extract141logstatsplain
d---------flow-tools-ng178logstatsplain
d---------flow-tools178logstatsplain
d---------flowd219logstatsplain
d---------flowviewer178logstatsplain
d---------fprobe141logstatsplain
d---------fruity178logstatsplain
d---------glpi-plugins-fusioninventory-server146logstatsplain
d---------glpi-plugins-tracker-agent185logstatsplain
d---------glpi-plugins-tracker-server185logstatsplain
d---------gps146logstatsplain
d---------grepcidr141logstatsplain
d---------grepip109logstatsplain
d---------gsnmp146logstatsplain
d---------hastmon109logstatsplain
d---------hawk178logstatsplain
d---------horde-nic146logstatsplain
d---------icinga178logstatsplain
d---------icmpmonitor141logstatsplain
d---------icmpquery141logstatsplain
d---------ifgraph178logstatsplain
d---------iftop141logstatsplain
d---------iog185logstatsplain
d---------ipacco178logstatsplain
d---------ipacctd178logstatsplain
d---------ipaudit217logstatsplain
d---------ipcad178logstatsplain
d---------ipcalc141logstatsplain
d---------ipfm146logstatsplain
d---------ipplan178logstatsplain
d---------ipv6calc141logstatsplain
d---------ipv6gen109logstatsplain
d---------ipv6mon178logstatsplain
d---------irrtoolset109logstatsplain
d---------isic146logstatsplain
d---------jnettop178logstatsplain
d---------kismet178logstatsplain
d---------lanmap178logstatsplain
d---------libsmi178logstatsplain
d---------macroscope178logstatsplain
d---------mbrowse109logstatsplain
d---------mk-livestatus141logstatsplain
d---------mrtg-ping-probe178logstatsplain
d---------mrtg178logstatsplain
d---------mtrace141logstatsplain
d---------nagcon141logstatsplain
d---------nagios-certexp-plugin109logstatsplain
d---------nagios-check_bacula146logstatsplain
d---------nagios-check_clamav109logstatsplain
d---------nagios-check_cpu_usage103logstatsplain
d---------nagios-check_email_delivery146logstatsplain
d---------nagios-check_hdd_health140logstatsplain
d---------nagios-check_hp_bladechassis109logstatsplain
d---------nagios-check_ice146logstatsplain
d---------nagios-check_kumofs105logstatsplain
d---------nagios-check_memcached_paranoid105logstatsplain
d---------nagios-check_mysql_slave146logstatsplain
d---------nagios-check_netsnmp105logstatsplain
d---------nagios-check_ports178logstatsplain
d---------nagios-check_puppet141logstatsplain
d---------nagios-check_smartmon178logstatsplain
d---------nagios-check_tftp141logstatsplain
d---------nagios-devel178logstatsplain
d---------nagios-geom178logstatsplain
d---------nagios-openldap-plugins109logstatsplain
d---------nagios-pf-plugin141logstatsplain
d---------nagios-plugins178logstatsplain
d---------nagios-portaudit178logstatsplain
d---------nagios-silfreed-plugins146logstatsplain
d---------nagios-snmp-plugins-extras146logstatsplain
d---------nagios-snmp-plugins146logstatsplain
d---------nagios-spamd-plugin109logstatsplain
d---------nagios178logstatsplain
d---------nagiosagent109logstatsplain
d---------nagiosgraph178logstatsplain
d---------nagiosgrapher178logstatsplain
d---------nagiosql178logstatsplain