aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorMichael Meeks <mmeeks@src.gnome.org>2000-09-13 03:10:06 +0800
committerMichael Meeks <mmeeks@src.gnome.org>2000-09-13 03:10:06 +0800
commit7f9156593dbaee0af8ae986f30ebe73ece9fbf48 (patch)
treeee9f9df951bcf85f510a865fc2b2b212f5ef2e44 /ui
parent86dc13ebf4706ec24b78f524428a57404957dc10 (diff)
downloadgsoc2013-evolution-7f9156593dbaee0af8ae986f30ebe73ece9fbf48.tar.gz
gsoc2013-evolution-7f9156593dbaee0af8ae986f30ebe73ece9fbf48.tar.zst
gsoc2013-evolution-7f9156593dbaee0af8ae986f30ebe73ece9fbf48.zip
Add UI xml files in a more sensible place.
svn path=/trunk/; revision=5378
Diffstat (limited to 'ui')
-rw-r--r--ui/Makefile.am10
-rw-r--r--ui/evolution-addressbook.xml62
-rw-r--r--ui/evolution-calendar.xml87
-rw-r--r--ui/evolution-mail.xml170
-rw-r--r--ui/evolution.xml105
5 files changed, 434 insertions, 0 deletions
diff --git a/ui/Makefile.am b/ui/Makefile.am
new file mode 100644
index 0000000000..473f06ce7b
--- /dev/null
+++ b/ui/Makefile.am
@@ -0,0 +1,10 @@
+XML_FILES = \
+ evolution.xml \
+ evolution-addressbook.xml \
+ evolution-mail.xml \
+ evolution-calendar.xml
+
+uidir = $(datadir)/gnome/ui
+ui_DATA = $(XML_FILES)
+
+EXTRA_DIST = $(XML_FILES)
diff --git a/ui/evolution-addressbook.xml b/ui/evolution-addressbook.xml
new file mode 100644
index 0000000000..13f86d4874
--- /dev/null
+++ b/ui/evolution-addressbook.xml
@@ -0,0 +1,62 @@
+<Root>
+
+ <menu>
+ <submenu name="File" _label="_File">
+
+ <placeholder name="Print">
+
+ <menuitem name="Print" verb="ContactsPrint"
+ _label="_Print Contacts..."
+ pixtype="stock" pixname="Menu_Print"/>
+
+ </placeholder>
+
+ </submenu>
+
+ <submenu name="View" _label="_View">
+
+ <menuitem name="AsTable" _label="As _Table"
+ verb="ViewAsTable"/>
+
+ <menuitem name="ViewNewContact" verb=""
+ _label="_New Contact"/>
+
+ </submenu>
+
+ <placeholder name="Component">
+
+ <submenu name="Tools" _label="_Tools">
+
+ <menuitem name="Search" verb="ToolSearch"
+ _label="_Search for contacts"
+ pixtype="stock" pixname="Menu_Search"/>
+
+ </submenu>
+
+ </placeholder>
+ </menu>
+
+ <dockitem name="Toolbar">
+ <toolitem name="New" _label="New"
+ _decr="Create a new contact" verb="ContactNew"
+ pixtype="stock" pixname="New"/>
+
+ <toolitem type="separator"/>
+
+ <toolitem name="Find" _label="Find"
+ _descr="Find a contact" verb="ContactFind"
+ pixtype="stock" pixname="Search"/>
+
+ <toolitem name="Print" _label="Print"
+ _descr="Print contacts" verb="ContactsPrint"
+ pixtype="stock" pixname="Print"/>
+
+ <toolitem name="Delete" label="Delete"
+ _descr="Delete a contact" verb="ContactDelete"
+ pixtype="stock" pixname="Trash"/>
+
+ <toolitem type="separator"/>
+
+ </dockitem>
+
+</Root> \ No newline at end of file
diff --git a/ui/evolution-calendar.xml b/ui/evolution-calendar.xml
new file mode 100644
index 0000000000..bbf73ef340
--- /dev/null
+++ b/ui/evolution-calendar.xml
@@ -0,0 +1,87 @@
+<Root>
+
+ <menu>
+ <submenu name="File" _label="_File">
+
+ <submenu name="New" _label="_New">
+
+ <menuitem name="CalendarNew" verb=""
+ _label="New Ca_lendar" _descr="Create a new calendar"/>
+
+ </submenu>
+
+ <submenu name="Open" _label="_Open">
+
+ <menuitem name="CalendarOpen" verb=""
+ _label="_Open Calendar" _descr="Open a calendar"/>
+
+ </submenu>
+
+ <menuitem name="CalendarSaveAs" verb=""
+ _label="_Save Calendar As" _descr="Save calendar As something else"/>
+
+ <placeholder name="Print">
+
+ <menuitem name="Print" verb="CalendarPrint"
+ _label="_Print this calendar"
+ pixtype="stock" pixname="Menu_Print"
+ accel="&lt;Control&gt;p"/>
+
+ </placeholder>
+
+ </submenu>
+
+ <submenu name="Edit" _label="_Edit">
+
+ <menuitem name="Appointment" _label="_New appointment..."
+ verb="EditNewAppointment" _descr="Create a new appointment"/>
+
+ <menuitem name="Preferences" _label="Preferences"
+ verb="CalendarPreferences" _descr="Alter preferences"/>
+
+ </submenu>
+
+ <submenu name="Help" _label="_Help">
+
+ <menuitem name="Calendar" _label="About Calendar"
+ _descr="All about the calendar" verb="AboutCalendar"/>
+
+ </submenu>
+ </menu>
+
+ <dockitem name="Toolbar">
+ <toolitem name="New" _label="New"
+ _decr="Create a new appointment" verb="EditNewAppointment"
+ pixtype="stock" pixname="New"/>
+
+ <toolitem type="separator"/>
+
+ <toolitem name="Print" _label="Print"
+ _descr="Print this calendar" verb="CalendarPrint"
+ pixtype="stock" pixname="Print"/>
+
+ <toolitem type="separator"/>
+
+ <toolitem name="Prev" label="Prev"
+ _descr="Go back in time" verb="CalendarPrev"
+ pixtype="stock" pixname="Back"/>
+
+ <toolitem name="Today" label="Today"
+ _descr="Go to present time" verb="CalendarToday"
+ pixtype="stock" pixname="Home"/>
+
+ <toolitem name="Next" label="Next"
+ _descr="Go forward in time" verb="CalendarNext"
+ pixtype="stock" pixname="Forward"/>
+
+ <toolitem type="separator"/>
+
+ <toolitem name="Goto" label="Go to"
+ _descr="Go to a specific data" verb="CalendarGoto"
+ pixtype="stock" pixname="Jump To"/>
+
+ <toolitem type="separator"/>
+
+ </dockitem>
+
+</Root> \ No newline at end of file
diff --git a/ui/evolution-mail.xml b/ui/evolution-mail.xml
new file mode 100644
index 0000000000..656edda83f
--- /dev/null
+++ b/ui/evolution-mail.xml
@@ -0,0 +1,170 @@
+<Root>
+ <menu>
+ <submenu name="File" _label="_File">
+
+ <placeholder name="Print">
+
+ <menuitem name="Print" verb="PrintMessage"
+ _label="Print message..."
+ _descr="Print message to the printer"
+ pixtype="stock" pixname="Menu_Print"/>
+<!-- do we need this separator ? -->
+
+ <menuitem/>
+
+ </placeholder>
+
+ </submenu>
+
+ <submenu name="View" _label="_View">
+
+ <menuitem/>
+
+ <menuitem name="Threaded" verb="ViewThreaded"
+ _label="_Threaded" _descr="Threaded Message list"/>
+
+ </submenu>
+
+ <submenu name="Settings" _label="_Settings">
+
+ <menuitem name="MailFilters" verb="SetMailFilter"
+ _label="Mail _Filters..."/>
+
+ <menuitem name="VFolderEdit" verb="SetVFolder"
+ _label="_Virtual Folder Editor..."/>
+
+ <menuitem name="SetMailConfig" verb=""
+ _label="_Mail Configuration..."/>
+
+ <menuitem name="SetForgetPwd" verb=""
+ _label="Forget _Passwords"/>
+
+ </submenu>
+
+ <placeholder name="Component">
+
+ <submenu name="Message" _label="_Message">
+
+ <menuitem name="MessageOpenNewWnd" verb=""
+ _label="_Open in New Window"
+ accel="&lt;Control&gt;o"/>
+
+ <menuitem name="MessageEdit" verb=""
+ _label="_Edit Message"/>
+
+ <menuitem name="MessagePrint" verb=""
+ _label="_Print Message"/>
+
+ <menuitem/>
+
+ <menuitem name="MessageReplySndr" verb=""
+ _label="Reply to _Sender"/>
+
+ <menuitem name="MessageReplyAll" verb=""
+ _label="Reply to _All"/>
+
+ <menuitem name="MessageForward" verb=""
+ _label="_Forward"/>
+
+ <menuitem/>
+
+ <menuitem name="MessageDelete" verb=""
+ _label="_Delete Message"/>
+
+ <menuitem name="MessageMove" verb=""
+ _label="_Move Message"/>
+
+ <menuitem name="MessageCopy" verb=""
+ _label="_Copy Message"/>
+
+ <menuitem/>
+
+ <menuitem name="MessageVFolderSubj" verb=""
+ _label="_VFolder on Subject"/>
+
+ <menuitem name="MessageVFolderSndr" verb=""
+ _label="VFolder on Se_nder"/>
+
+ <menuitem name="MessageVFolderRecip" verb=""
+ _label="VFolder on _Recipients"/>
+
+ <menuitem/>
+
+ <menuitem name="MessageFilterSubj" verb=""
+ _label="_Filter on Subject"/>
+
+ <menuitem name="MessageFilterSndr" verb=""
+ _label="Fi_lter on Sender"/>
+
+ <menuitem name="MessageFilterRecip" verb=""
+ _label="Filter on Rec_ipients"/>
+
+ </submenu>
+
+ <submenu name="Folder" _label="F_older">
+
+ <menuitem name="FolderMarkAllRead" verb=""
+ _label="_Mark all as Read"/>
+
+ <menuitem name="FolderDeleteAll" verb=""
+ _label="_Delete all"/>
+
+ <menuitem name="FolderExpunge" verb=""
+ _label="_Expunge"/>
+
+ <menuitem name="FolderConfig" verb=""
+ _label="_Configure Folder"/>
+
+ </submenu>
+
+ </placeholder>
+ </menu>
+
+ <dockitem name="Toolbar">
+
+ <toolitem name="MailGet" verb=""
+ _label="Get Mail" _descr="Send queued mail and retrieve new mail"
+ pixtype="stock" pixname="Receive Mail"/>
+
+ <toolitem name="MailCompose" verb=""
+ _label="Compose" _descr="Compose a new message"
+ pixtype="stock" pixname="New Mail"/>
+
+ <toolitem type="separator"/>
+
+ <toolitem name="Reply" verb="MessageReplySndr"
+ _label="Reply" _descr="Reply to the sender of this message"
+ pixtype="stock" pixname="Reply to Mail"/>
+
+ <toolitem name="ReplyAll" verb="MessageReplyAll"
+ _label="Reply to All" _descr="Reply to all recipients of this message"
+ pixtype="stock" pixname="Reply to Mail"/>
+
+ <toolitem name="Forward" verb="MessageForward"
+ _label="Forward" _descr="Forward this message"
+ pixtype="stock" pixname="Forward Mail"/>
+
+ <toolitem type="separator"/>
+
+ <toolitem name="Move" verb="MessageMove"
+ _label="Move" _descr="Move message to a new folder"
+ pixtype="stock" pixname="Send Mail"/>
+
+ <toolitem name="Copy" verb="MessageCopy"
+ _label="Copy" _descr="Copy message to a new folder"
+ pixtype="stock" pixname="Send Mail"/>
+
+ <toolitem name="Print" verb="MessagePrint"
+ _label="Print" _descr="Print the selected message"
+ pixtype="stock" pixname="Print"/>
+
+ <toolitem name="Copy" verb="MessageCopy"
+ _label="Copy" _descr="Copy message to a new folder"
+ pixtype="stock" pixname="Send Mail"/>
+
+ <toolitem name="Copy" verb="MessageDelete"
+ _label="Delete" _descr="Delete this message"
+ pixtype="stock" pixname="Trash"/>
+
+ </dockitem>
+</Root> \ No newline at end of file
diff --git a/ui/evolution.xml b/ui/evolution.xml
new file mode 100644
index 0000000000..a3127f4874
--- /dev/null
+++ b/ui/evolution.xml
@@ -0,0 +1,105 @@
+<Root>
+ <menu>
+ <submenu name="File" _label="_File">
+ <submenu name="New" _label="_New">
+ <menuitem name="View" verb="NewView" _label="_View"
+ accel="&lt;Control&gt;&lt;Shift&gt;v"
+ pixtype="stock" pixname="Menu_New"/>
+
+ <menuitem name="Folder" verb="NewFolder"
+ _label="_Folder"
+ accel="&lt;Control&gt;&lt;Shift&gt;f"/>
+
+ <menuitem name="Shortcut" verb="NewBarShortcut"
+ _label="Evolution bar _shortcut"
+ accel="&lt;Control&gt;&lt;Shift&gt;s"/>
+
+ <menuitem/>
+
+ <menuitem name="Mail" verb="NewMailMessage"
+ _label="_Mail message (FIXME)"
+ accel="&lt;Control&gt;&lt;Shift&gt;m"/>
+
+ <menuitem name="Appointment" verb="NewAppointment"
+ _label="_Appointment (FIXME)"
+ accel="&lt;Control&gt;&lt;Shift&gt;a"/>
+
+ <menuitem name="Contact" verb="NewContact"
+ _label="_Contact (FIXME)"
+ accel="&lt;Control&gt;&lt;Shift&gt;c"/>
+
+ <menuitem name="Task" verb="NewTask"
+ _label="_Task (FIXME)"
+ accel="&lt;Control&gt;&lt;Shift&gt;t"/>
+ </submenu>
+
+ <menuitem/>
+
+ <menuitem name="FileGoToFolder" verb=""
+ _label="_Go to Folder..."
+ _descr="Display a different folder"/>
+
+ <menuitem name="FileCreateFolder" verb=""
+ _label="_Create New Folder..."
+ _descr="Create a new folder"/>
+
+ <placeholder name="Print" delimit="bottom"/>
+
+ <menuitem name="FileExit" verb=""
+ _label="E_xit" _descr="Exit the program"
+ pixtype="stock" pixname="Menu_Quit"
+ accel="&lt;Control&gt;q"/>
+
+ </submenu>
+
+ <submenu name="Edit" _label="_Edit"/>
+
+ <submenu name="View" _label="_View">
+
+ <menuitem name="ShortcutBar" type="toggle"
+ id="ViewShortcutBar" _label="Show the _Shortcut Bar"
+ _descr="Toggle whether to show the shortcut bar"/>
+
+ <menuitem name="FolderBar" type="toggle"
+ id="ViewFolderBar" _label="Show the _Folder Bar"
+ _descr="Toggle whether to show the folder bar"/>
+
+ </submenu>
+
+ <submenu name="Settings" _label="_Settings"/>
+
+ <placeholder name="Component"/>
+
+ <submenu name="Help" _label="_Help">
+
+ <menuitem name="HelpIndex" verb=""
+ _label="_Index"/>
+
+ <menuitem name="HelpGetStarted" verb=""
+ _label="Getting _Started"/>
+
+ <menuitem name="HelpUsingMail" verb=""
+ _label="Using the _Mailer"/>
+
+ <menuitem name="HelpUsingCalender" verb=""
+ _label="Using the _Calender"/>
+
+ <menuitem name="HelpUsingContact" verb=""
+ _label="Using the C_ontact Manager"/>
+
+ <menuitem/>
+
+ <menuitem name="HelpSubmitBug" verb=""
+ _label="_Submit Bug Report"
+ _descr="Submit bug report using Bug Buddy"/>
+
+ <menuitem/>
+
+ <menuitem name="HelpAbout" verb=""
+ _label="_About Evolution..."
+ _descr="Show information about Evolution"
+ pixtype="stock" pixname="Menu_About"/>
+
+ </submenu>
+ </menu>
+</Root> \ No newline at end of file
lor:#3a3935">; return ret; } static void gal_a11y_e_cell_dispose (GObject *object) { GalA11yECell *a11y = GAL_A11Y_E_CELL (object); #if 0 if (a11y->item) g_object_unref (G_OBJECT (a11y->item)); /*, unref_item, a11y); */ if (a11y->cell_view) g_object_unref (G_OBJECT (a11y->cell_view)); /*, unref_cell, a11y); */ if (a11y->parent) g_object_unref (a11y->parent); #endif if (a11y->state_set) { g_object_unref (a11y->state_set); a11y->state_set = NULL; } if (parent_class->dispose) parent_class->dispose (object); } /* Static functions */ static G_CONST_RETURN gchar * gal_a11y_e_cell_get_name (AtkObject * a11y) { GalA11yECell *cell = GAL_A11Y_E_CELL (a11y); ETableCol *ecol; if (a11y->name != NULL && strcmp (a11y->name, "")) return a11y->name; if (cell->item != NULL) { ecol = e_table_header_get_column (cell->item->header, cell->view_col); if (ecol != NULL) return ecol->text; } return _("Table Cell"); } static AtkStateSet * gal_a11y_e_cell_ref_state_set (AtkObject *accessible) { GalA11yECell *cell = GAL_A11Y_E_CELL (accessible); g_return_val_if_fail (cell->state_set, NULL); g_object_ref (cell->state_set); return cell->state_set; } static AtkObject* gal_a11y_e_cell_get_parent (AtkObject *accessible) { GalA11yECell *a11y = GAL_A11Y_E_CELL (accessible); return a11y->parent; } static gint gal_a11y_e_cell_get_index_in_parent (AtkObject *accessible) { GalA11yECell *a11y = GAL_A11Y_E_CELL (accessible); if (!is_valid (accessible)) return -1; return (a11y->row + 1) * a11y->item->cols + a11y->view_col; } /* Component IFace */ static void gal_a11y_e_cell_get_extents (AtkComponent *component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type) { GalA11yECell *a11y = GAL_A11Y_E_CELL (component); GtkWidget *tableOrTree; gint row; gint col; gint xval; gint yval; row = a11y->row; col = a11y->view_col; tableOrTree = gtk_widget_get_parent (GTK_WIDGET (a11y->item->parent.canvas)); if (E_IS_TREE (tableOrTree)) { e_tree_get_cell_geometry (E_TREE (tableOrTree), row, col, &xval, &yval, width, height); } else { e_table_get_cell_geometry (E_TABLE (tableOrTree), row, col, &xval, &yval, width, height); } atk_component_get_position (ATK_COMPONENT (a11y->parent), x, y, coord_type); if (x && *x != G_MININT) *x += xval; if (y && *y != G_MININT) *y += yval; } static gboolean gal_a11y_e_cell_grab_focus (AtkComponent *component) { GalA11yECell *a11y; gint index; GtkWidget *toplevel; GalA11yETableItem *a11yTableItem; a11y = GAL_A11Y_E_CELL (component); /* for e_cell_vbox's children, we just grab the e_cell_vbox */ if (GAL_A11Y_IS_E_CELL_VBOX (a11y->parent)) { return atk_component_grab_focus (ATK_COMPONENT (a11y->parent)); } a11yTableItem = GAL_A11Y_E_TABLE_ITEM (a11y->parent); index = atk_object_get_index_in_parent (ATK_OBJECT (a11y)); atk_selection_clear_selection (ATK_SELECTION (a11yTableItem)); atk_selection_add_selection (ATK_SELECTION (a11yTableItem), index); gtk_widget_grab_focus ( GTK_WIDGET (GNOME_CANVAS_ITEM (a11y->item)->canvas)); toplevel = gtk_widget_get_toplevel ( GTK_WIDGET (GNOME_CANVAS_ITEM (a11y->item)->canvas)); if (toplevel && gtk_widget_is_toplevel (toplevel)) gtk_window_present (GTK_WINDOW (toplevel)); return TRUE; } /* Table IFace */ static void gal_a11y_e_cell_atk_component_iface_init (AtkComponentIface *iface) { iface->get_extents = gal_a11y_e_cell_get_extents; iface->grab_focus = gal_a11y_e_cell_grab_focus; } static void gal_a11y_e_cell_class_init (GalA11yECellClass *class) { AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (class); GObjectClass *object_class = G_OBJECT_CLASS (class); parent_class = g_type_class_ref (PARENT_TYPE); object_class->dispose = gal_a11y_e_cell_dispose; atk_object_class->get_parent = gal_a11y_e_cell_get_parent; atk_object_class->get_index_in_parent = gal_a11y_e_cell_get_index_in_parent; atk_object_class->ref_state_set = gal_a11y_e_cell_ref_state_set; atk_object_class->get_name = gal_a11y_e_cell_get_name; } static void gal_a11y_e_cell_init (GalA11yECell *a11y) { a11y->item = NULL; a11y->cell_view = NULL; a11y->parent = NULL; a11y->model_col = -1; a11y->view_col = -1; a11y->row = -1; a11y->state_set = atk_state_set_new (); atk_state_set_add_state (a11y->state_set, ATK_STATE_TRANSIENT); atk_state_set_add_state (a11y->state_set, ATK_STATE_ENABLED); atk_state_set_add_state (a11y->state_set, ATK_STATE_SENSITIVE); atk_state_set_add_state (a11y->state_set, ATK_STATE_SELECTABLE); atk_state_set_add_state (a11y->state_set, ATK_STATE_SHOWING); atk_state_set_add_state (a11y->state_set, ATK_STATE_FOCUSABLE); atk_state_set_add_state (a11y->state_set, ATK_STATE_VISIBLE); } static ActionInfo * _gal_a11y_e_cell_get_action_info (GalA11yECell *cell, gint index) { GList *list_node; g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), NULL); if (cell->action_list == NULL) return NULL; list_node = g_list_nth (cell->action_list, index); if (!list_node) return NULL; return (ActionInfo *) (list_node->data); } static void _gal_a11y_e_cell_destroy_action_info (gpointer action_info, gpointer user_data) { ActionInfo *info = (ActionInfo *) action_info; g_return_if_fail (info != NULL); g_free (info->name); g_free (info->description); g_free (info->keybinding); g_free (info); } gboolean gal_a11y_e_cell_add_action ( GalA11yECell * cell, const gchar *action_name, const gchar *action_description, const gchar *action_keybinding, ACTION_FUNC action_func) { ActionInfo *info; g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), FALSE); info = g_new (ActionInfo, 1); if (action_name != NULL) info->name = g_strdup (action_name); else info->name = NULL; if (action_description != NULL) info->description = g_strdup (action_description); else info->description = NULL; if (action_keybinding != NULL) info->keybinding = g_strdup (action_keybinding); else info->keybinding = NULL; info->do_action_func = action_func; cell->action_list = g_list_append (cell->action_list, (gpointer) info); return TRUE; } gboolean gal_a11y_e_cell_remove_action (GalA11yECell *cell, gint action_index) { GList *list_node; g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), FALSE); list_node = g_list_nth (cell->action_list, action_index); if (!list_node) return FALSE; g_return_val_if_fail (list_node->data != NULL, FALSE); _gal_a11y_e_cell_destroy_action_info (list_node->data, NULL); cell->action_list = g_list_remove_link (cell->action_list, list_node); return TRUE; } gboolean gal_a11y_e_cell_remove_action_by_name (GalA11yECell *cell, const gchar *action_name) { GList *list_node; gboolean action_found= FALSE; g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), FALSE); for (list_node = cell->action_list; list_node && !action_found; list_node = list_node->next) { if (!g_ascii_strcasecmp ( ((ActionInfo *)(list_node->data))->name, action_name)) { action_found = TRUE; break; } } g_return_val_if_fail (action_found, FALSE); _gal_a11y_e_cell_destroy_action_info (list_node->data, NULL); cell->action_list = g_list_remove_link (cell->action_list, list_node); return TRUE; } static gint gal_a11y_e_cell_action_get_n_actions (AtkAction *action) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); if (cell->action_list != NULL) return g_list_length (cell->action_list); else return 0; } static G_CONST_RETURN gchar * gal_a11y_e_cell_action_get_name (AtkAction *action, gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); if (info == NULL) return NULL; return info->name; } static G_CONST_RETURN gchar * gal_a11y_e_cell_action_get_description (AtkAction *action, gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); if (info == NULL) return NULL; return info->description; } static gboolean gal_a11y_e_cell_action_set_description (AtkAction *action, gint index, const gchar *desc) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); if (info == NULL) return FALSE; g_free (info->description); info->description = g_strdup (desc); return TRUE; } static G_CONST_RETURN gchar * gal_a11y_e_cell_action_get_keybinding (AtkAction *action, gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); if (info == NULL) return NULL; return info->keybinding; } static gboolean idle_do_action (gpointer data) { GalA11yECell *cell; cell = GAL_A11Y_E_CELL (data); if (!is_valid (ATK_OBJECT (cell))) return FALSE; cell->action_idle_handler = 0; cell->action_func (cell); g_object_unref (cell); return FALSE; } static gboolean gal_a11y_e_cell_action_do_action (AtkAction *action, gint index) { GalA11yECell *cell = GAL_A11Y_E_CELL (action); ActionInfo *info = _gal_a11y_e_cell_get_action_info (cell, index); if (!is_valid (ATK_OBJECT (action))) return FALSE; if (info == NULL) return FALSE; g_return_val_if_fail (info->do_action_func, FALSE); if (cell->action_idle_handler) return FALSE; cell->action_func = info->do_action_func; g_object_ref (cell); cell->action_idle_handler = g_idle_add (idle_do_action, cell); return TRUE; } static void gal_a11y_e_cell_atk_action_interface_init (AtkActionIface *iface) { g_return_if_fail (iface != NULL); iface->get_n_actions = gal_a11y_e_cell_action_get_n_actions; iface->do_action = gal_a11y_e_cell_action_do_action; iface->get_name = gal_a11y_e_cell_action_get_name; iface->get_description = gal_a11y_e_cell_action_get_description; iface->set_description = gal_a11y_e_cell_action_set_description; iface->get_keybinding = gal_a11y_e_cell_action_get_keybinding; } void gal_a11y_e_cell_type_add_action_interface (GType type) { static const GInterfaceInfo atk_action_info = { (GInterfaceInitFunc) gal_a11y_e_cell_atk_action_interface_init, (GInterfaceFinalizeFunc) NULL, NULL }; g_type_add_interface_static (type, ATK_TYPE_ACTION, &atk_action_info); } gboolean gal_a11y_e_cell_add_state (GalA11yECell *cell, AtkStateType state_type, gboolean emit_signal) { if (!atk_state_set_contains_state (cell->state_set, state_type)) { gboolean rc; rc = atk_state_set_add_state (cell->state_set, state_type); /* * The signal should only be generated if the value changed, * not when the cell is set up. So states that are set * initially should pass FALSE as the emit_signal argument. */ if (emit_signal) { atk_object_notify_state_change (ATK_OBJECT (cell), state_type, TRUE); /* If state_type is ATK_STATE_VISIBLE, additional notification */ if (state_type == ATK_STATE_VISIBLE) g_signal_emit_by_name (cell, "visible_data_changed"); } return rc; } else return FALSE; } gboolean gal_a11y_e_cell_remove_state (GalA11yECell *cell, AtkStateType state_type, gboolean emit_signal) { if (atk_state_set_contains_state (cell->state_set, state_type)) { gboolean rc; rc = atk_state_set_remove_state (cell->state_set, state_type); /* * The signal should only be generated if the value changed, * not when the cell is set up. So states that are set * initially should pass FALSE as the emit_signal argument. */ if (emit_signal) { atk_object_notify_state_change (ATK_OBJECT (cell), state_type, FALSE); /* If state_type is ATK_STATE_VISIBLE, additional notification */ if (state_type == ATK_STATE_VISIBLE) g_signal_emit_by_name (cell, "visible_data_changed"); } return rc; } else return FALSE; } /** * gal_a11y_e_cell_get_type: * @void: * * Registers the &GalA11yECell class if necessary, and returns the type ID * associated to it. * * Return value: The type ID of the &GalA11yECell class. **/ GType gal_a11y_e_cell_get_type (void) { static GType type = 0; if (!type) { GTypeInfo info = { sizeof (GalA11yECellClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gal_a11y_e_cell_class_init, (GClassFinalizeFunc) NULL, NULL, /* class_data */ sizeof (GalA11yECell), 0, (GInstanceInitFunc) gal_a11y_e_cell_init, NULL /* value_cell */ }; static const GInterfaceInfo atk_component_info = { (GInterfaceInitFunc) gal_a11y_e_cell_atk_component_iface_init, (GInterfaceFinalizeFunc) NULL, NULL }; type = g_type_register_static (PARENT_TYPE, "GalA11yECell", &info, 0); g_type_add_interface_static (type, ATK_TYPE_COMPONENT, &atk_component_info); } return type; } AtkObject * gal_a11y_e_cell_new (ETableItem *item, ECellView *cell_view, AtkObject *parent, gint model_col, gint view_col, gint row) { AtkObject *a11y; a11y = g_object_new (gal_a11y_e_cell_get_type (), NULL); gal_a11y_e_cell_construct (a11y, item, cell_view, parent, model_col, view_col, row); return a11y; } void gal_a11y_e_cell_construct (AtkObject *object, ETableItem *item, ECellView *cell_view, AtkObject *parent, gint model_col, gint view_col, gint row) { GalA11yECell *a11y = GAL_A11Y_E_CELL (object);