1 /* -*- mode: c; c-basic-offset: 4; -*- 2 * 3 * explorer.h - An interactive GUI for manipulating an IterativeMap 4 * object and viewing its output 5 * 6 * Fyre - rendering and interactive exploration of chaotic functions 7 * Copyright (C) 2004-2006 David Trowbridge and Micah Dowty 8 * 9 * This program is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU General Public License 11 * as published by the Free Software Foundation; either version 2 12 * of the License, or (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with this program; if not, write to the Free Software 21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 * 23 */ 24 25 #ifndef __EXPLORER_H__ 26 #define __EXPLORER_H__ 27 28 #include <gtk/gtk.h> 29 #include <glade/glade.h> 30 #include "animation.h" 31 #include "animation-render-ui.h" 32 #include "screensaver.h" 33 34 #ifdef HAVE_GNET 35 #include "cluster-model.h" 36 #endif 37 38 G_BEGIN_DECLS 39 40 #define EXPLORER_TYPE (explorer_get_type ()) 41 #define EXPLORER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXPLORER_TYPE, Explorer)) 42 #define EXPLORER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXPLORER_TYPE, ExplorerClass)) 43 #define IS_EXPLORER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXPLORER_TYPE)) 44 #define IS_EXPLORER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXPLORER_TYPE)) 45 46 typedef struct _Explorer Explorer; 47 typedef struct _ExplorerClass ExplorerClass; 48 49 struct _Explorer { 50 GObject object; 51 52 IterativeMap* map; 53 Animation* animation; 54 AnimationRenderUi* render_window; 55 56 GladeXML* xml; 57 GtkWidget* window; 58 GtkWidget* view; 59 GtkWidget* fgcolor_button; 60 GtkWidget* bgcolor_button; 61 62 ScreenSaver* about_image; 63 64 GtkStatusbar* statusbar; 65 guint render_status_message_id; 66 guint render_status_context; 67 gboolean status_dirty_flag; 68 69 GTimer* auto_update_rate_timer; 70 GTimer* status_update_rate_timer; 71 GTimer* speed_timer; 72 double last_iterations; 73 double iter_speed; 74 75 gchar* current_tool; 76 gboolean tool_active; 77 double last_mouse_x; 78 double last_mouse_y; 79 double last_click_x; 80 double last_click_y; 81 GTimeVal last_tool_idle_update; 82 83 GtkWidget* anim_curve; 84 gboolean allow_transition_changes; 85 gboolean selecting_keyframe; 86 87 gboolean seeking_animation; 88 gboolean seeking_animation_transition; 89 gboolean playing_animation; 90 91 gboolean unpause_on_restore; 92 93 GTimeVal last_anim_frame_time; 94 95 GQueue* history_queue; 96 guint history_timer; 97 GList* history_current_link; 98 gboolean history_freeze; 99 100 #ifdef HAVE_GNET 101 ClusterModel* cluster_model; 102 #endif 103 }; 104 105 struct _ExplorerClass { 106 GObjectClass parent_class; 107 }; 108 109 110 /************************************************************************************/ 111 /******************************************************************* Public Methods */ 112 /************************************************************************************/ 113 114 GType explorer_get_type(); 115 Explorer* explorer_new (IterativeMap *map, Animation *animation); 116 117 118 /************************************************************************************/ 119 /***************************************************************** Internal methods */ 120 /************************************************************************************/ 121 122 void explorer_init_tools (Explorer *self); 123 gboolean explorer_update_tools (Explorer *self); 124 125 void explorer_init_animation (Explorer *self); 126 void explorer_dispose_animation (Explorer *self); 127 void explorer_update_animation (Explorer *self); 128 129 void explorer_init_cluster (Explorer *self); 130 void explorer_dispose_cluster (Explorer *self); 131 132 void explorer_init_about (Explorer *self); 133 134 void explorer_init_history (Explorer *self); 135 void explorer_dispose_history (Explorer *self); 136 137 void explorer_run_iterations (Explorer *self); 138 void explorer_update_gui (Explorer *self); 139 140 void explorer_force_pause (Explorer *self); 141 void explorer_restore_pause (Explorer *self); 142 143 G_END_DECLS 144 145 #endif /* __EXPLORER_H__ */ 146 147 /* The End */ 148