1 /* 2 * watch_model.h 3 * 4 * Copyright 2010 Alexander Petukhov <devel(at)apetukhov.ru> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 * MA 02110-1301, USA. 20 */ 21 22 #ifndef WATCH_MODEL_H 23 #define WATCH_MODEL_H 24 25 #include <glib.h> 26 #include <gtk/gtk.h> 27 28 /* tree view columns */ 29 enum 30 { 31 W_NAME, 32 W_VALUE, 33 W_TYPE, 34 W_LAST_VISIBLE, 35 W_INTERNAL, 36 W_EXPRESSION, 37 W_STUB, 38 W_CHANGED, 39 W_VT, 40 W_N_COLUMNS 41 }; 42 43 /* types for the callbacks */ 44 typedef void (*watch_expanded_callback)(GtkTreeView *tree_view, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data); 45 typedef void (*new_watch_dragged)(GtkWidget *wgt, GdkDragContext *context, int x, int y, GtkSelectionData *seldata, guint info, guint time, gpointer userdata); 46 typedef gboolean (*watch_key_pressed)(GtkWidget *widget, GdkEvent *event, gpointer user_data); 47 typedef gboolean (*watch_button_pressed)(GtkWidget *treeview, GdkEventButton *event, gpointer userdata); 48 typedef void (*watch_render_name)(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data); 49 typedef void (*watch_expression_changed)(GtkCellRendererText *renderer, gchar *path, gchar *new_text, gpointer user_data); 50 51 void update_variables(GtkTreeView *tree, GtkTreeIter *parent, GList *vars); 52 void clear_watch_values(GtkTreeView *tree); 53 GList* get_root_items(GtkTreeView *tree); 54 void change_watch(GtkTreeView *tree, GtkTreeIter *iter, gpointer var); 55 void free_variables_list(GList *vars); 56 void variable_set_name_only(GtkTreeStore *store, GtkTreeIter *iter, gchar *name); 57 void expand_stub(GtkTreeView *tree, GtkTreeIter *parent, GList *vars); 58 59 #endif /* guard */ 60