Changeset 59
- Timestamp:
- 10/23/09 17:58:55 (2 years ago)
- Location:
- branches/clutter-experiments
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/clutter-experiments/main.cc
r57 r59 61 61 gfloat x, y; 62 62 clutter_event_get_coords (event, &x, &y); 63 g_print ("Stage clicked at (% d, %d)\n", x, y);63 g_print ("Stage clicked at (%f, %f)\n", x, y); 64 64 // clutter cluttered my first draw, so redraw on click to allow testing. 65 clutter_actor_queue_redraw(CLUTTER_ACTOR(stage));65 // clutter_actor_queue_redraw(CLUTTER_ACTOR(stage)); 66 66 return TRUE; /* Stop further handling of this event. */ 67 67 } … … 169 169 170 170 /* 171 // ----------------------------------------------172 // render low res version of all pages173 // TODO: show fancy progress bar in the meantime.174 // ----------------------------------------------175 for(int ii(0); ii != doc.n_pages(); ++ii)176 doc.page(ii).render(pdfcube::page::LOW_RES);177 178 179 171 // -------------------------- 180 172 // arrange pages in an index -
branches/clutter-experiments/page.hh
r56 r59 21 21 * Usually, on start, all the pages will be rendered in a low res 22 22 * version, while higher res versions will be rendered on demand by 23 * the animations. We need to program the animations in advance so 24 * that we can pre-render hi-res versions of the pages before the 25 * animations begins. One way can be to read animations from the 26 * PDF. 23 * the animations. 24 * 25 * While displaying one page the following page is rendered in high 26 * resolution. No forward animation is possible until the rendering 27 * finishes. 27 28 * 28 29 */ … … 105 106 { 106 107 int w, h; 107 // we assume 4/3 aspect monitor can be done better108 // FIXME: we assume 4/3 aspect monitor. 108 109 double box_w = 1600; 109 110 double box_h = 1200; -
branches/clutter-experiments/pdfcube.hh
r57 r59 1 1 #pragma once 2 3 #include <cassert> 2 4 3 5 namespace pdfcube { … … 95 97 g_thread_create(render_thread, this, FALSE, NULL); 96 98 99 clutter_actor_set_reactive(the_stage_m, TRUE); 100 g_signal_connect(the_stage_m, 101 "key-press-event", 102 G_CALLBACK (pdfcube::app::keypress_event), 103 NULL); 97 104 clutter_threads_enter(); 98 105 clutter_main(); … … 174 181 clutter_actor_set_size(me->current_page_m, w, h); 175 182 clutter_container_add_actor(CLUTTER_CONTAINER(me->the_stage_m), 176 me->current_page_m); 183 me->current_page_m); 184 185 ClutterBindingPool *binding_pool; 186 std::cerr << G_OBJECT_TYPE_NAME(me->the_stage_m) << std::endl; 187 binding_pool = clutter_binding_pool_new(G_OBJECT_TYPE_NAME(me->the_stage_m)); 188 189 clutter_binding_pool_install_action(binding_pool, 190 "move-up", 191 CLUTTER_Up, (ClutterModifierType)0, 192 G_CALLBACK(pdfcube::app::action_move_up), 193 me, 194 NULL); 195 196 clutter_binding_pool_install_action(binding_pool, 197 "move-up", 198 CLUTTER_KP_Up, (ClutterModifierType)0, 199 G_CALLBACK(pdfcube::app::action_move_up), 200 me, 201 NULL); 202 177 203 return FALSE; 178 204 } … … 211 237 } 212 238 239 ////////////////////////////////////////////////////////////////////// 240 // 241 // Callbacks 242 // 243 static gboolean keypress_event(ClutterActor* actor, 244 ClutterEvent* evt, 245 gpointer data) 246 { 247 pdfcube::app* self = (pdfcube::app*)data; 248 ClutterKeyEvent* key_evt = (ClutterKeyEvent*)evt; 249 ClutterBindingPool *pool = NULL; 250 251 std::cerr << " * " << G_OBJECT_TYPE_NAME(actor) << std::endl; 252 /* retrieve the binding pool for the type of the actor */ 253 pool = clutter_binding_pool_find(G_OBJECT_TYPE_NAME(actor)); 254 255 assert(pool); 256 /* activate any callback matching the key symbol and modifiers 257 * mask of the key event. the returned value can be directly 258 * used to signal that the actor has handled the event. 259 */ 260 return clutter_binding_pool_activate (pool, 261 (guint)key_evt->keyval, 262 (ClutterModifierType)key_evt->modifier_state, 263 G_OBJECT(actor)); 264 265 } 266 267 static gboolean action_move_up(GObject *instance, 268 const gchar *action_name, 269 guint key_val, 270 ClutterModifierType modifiers, 271 gpointer user_data) 272 { 273 std::cerr << "move-up" << std::endl; 274 } 275 276 277 213 278 }; 214 279 }

