void unit_animation_component::set_selecting()
{
	const display *disp =  display::get_singleton();
	if (preferences::show_standing_animations() && !u_.incapacitated()) {
		start_animation(INT_MAX, choose_animation(*disp, u_.loc_, "selected"),
			true, "", 0, STATE_FORGET);
	} else {
		start_animation(INT_MAX, choose_animation(*disp, u_.loc_, "_disabled_selected_"),
			true, "", 0, STATE_FORGET);
	}
}
void unit_animation_component::set_standing(bool with_bars)
{
	display *disp = display::get_singleton();
	if (preferences::show_standing_animations()&& !u_.incapacitated()) {
		start_animation(INT_MAX, choose_animation(*disp, u_.loc_, "standing"),
			with_bars,  "", 0, STATE_STANDING);
	} else {
		start_animation(INT_MAX, choose_animation(*disp, u_.loc_, "_disabled_"),
			with_bars,  "", 0, STATE_STANDING);
	}
}
Exemple #3
0
static gboolean
gd_notification_visibility_notify_event (GtkWidget          *widget,
                                          GdkEventVisibility  *event)
{
  GdNotification *notification = GD_NOTIFICATION (widget);
  GdNotificationPrivate *priv = notification->priv;

  if (!gtk_widget_get_visible (widget))
    return FALSE;

  if (priv->waiting_for_viewable)
    {
      start_animation (notification);
      priv->waiting_for_viewable = FALSE;
    }

  if (notification->priv->timeout_source_id == 0 &&
      notification->priv->timeout != -1)
    notification->priv->timeout_source_id =
      gdk_threads_add_timeout (notification->priv->timeout * 1000,
                               gd_notification_timeout_cb,
                               widget);

  return FALSE;
}
Exemple #4
0
static bool
show_splash_screen (ply_boot_splash_plugin_t *plugin,
                    ply_event_loop_t         *loop,
                    ply_buffer_t             *boot_buffer,
                    ply_boot_splash_mode_t    mode)
{
  assert (plugin != NULL);

  if (ply_list_get_length (plugin->displays) == 0)
    {
      ply_trace ("no pixel displays");
      return false;
    }

  plugin->loop = loop;
  plugin->mode = mode;

  ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
                                 detach_from_event_loop,
                                 plugin);

  ply_event_loop_watch_signal (plugin->loop,
                               SIGINT,
                               (ply_event_handler_t)
                               on_interrupt, plugin);

  ply_trace ("starting boot animation");
  return start_animation (plugin);
}
Exemple #5
0
void Skitt::process_command(char *command)
{
	if (!strcmp(command, "play")) {
		printf("Starting to stream animations for single play mode... ");
		animation->setPlayMode(SINGLE);
		if (!this->start_animation()) {
			printf("Failed to start animation.\n");
		}
		printf("Animation started.\n");
	} else if (!strcmp(command,"loop")) {
		animation->setPlayMode(LOOP);
		if (!start_animation()) {
			printf("Failed to start animation.\n");
		}
		printf("Animation started.\n");
	} else if (!strcmp(command,"rand")) {
	} else if (!strcmp(command,"stop") || !strcmp(command,"q")) {
			printf("Stopping animation... ");
			stop_animation();
			stop_playback_loop();
			printf("Animation stopped.\n");
			done = true;
	} else {
		printf("Command not recognized.\n");
	}
}
void unit_animation_component::set_ghosted(bool with_bars)
{
	display *disp = display::get_singleton();
	start_animation(INT_MAX, choose_animation(*disp, u_.loc_, "ghosted"),
			with_bars);
	anim_->pause_animation();
}
void terrain_builder::add_rule(building_ruleset& rules, building_rule &rule, int precedence)
{
	if(rule_valid(rule)) {
		start_animation(rule);
		rules.insert(std::pair<int, building_rule>(precedence, rule));
	}
}
Exemple #8
0
static void
display_message (ply_boot_splash_plugin_t *plugin,
                 const char               *message)
{
        if (plugin->message != NULL)
                free (plugin->message);

        plugin->message = strdup (message);
        start_animation (plugin);
}
Exemple #9
0
static void
display_normal (ply_boot_splash_plugin_t *plugin)
{
        pause_views (plugin);
        if (plugin->state != PLY_BOOT_SPLASH_DISPLAY_NORMAL) {
                plugin->state = PLY_BOOT_SPLASH_DISPLAY_NORMAL;
                start_animation (plugin);
                redraw_views (plugin);
        }
        unpause_views (plugin);
}
Exemple #10
0
void animation_previous()
{
    stop_animation();
    if (current_animation == animation_type_o_matic)
        current_animation = animation_LAST;
    current_animation = (animation_names)decrement(current_animation, 1, 0, animation_LAST);
    dprintf("animation_previous: %u\n", current_animation);

    set_animation(current_animation);
    start_animation();
}
Exemple #11
0
void animation_next()
{
    stop_animation();

    current_animation = (animation_names)increment(current_animation, 1, 0, animation_LAST);
    if (current_animation == animation_LAST)
        current_animation = animation_type_o_matic;
    dprintf("animation_next: %u\n", current_animation);

    set_animation(current_animation);
    start_animation();
}
Exemple #12
0
void animation_toggle(void)
{
    dprintf("animation_toggle\r\n");

    if (animation_is_running())
    {
        stop_animation();
        return;
    }

    set_animation(current_animation);
    start_animation();
}
Exemple #13
0
void
gd_notification_dismiss (GdNotification *notification)
{
  GdNotificationPrivate *priv = notification->priv;

  if (notification->priv->timeout_source_id)
    {
      g_source_remove (notification->priv->timeout_source_id);
      notification->priv->timeout_source_id = 0;
    }

  priv->dismissed = TRUE;
  priv->revealed = FALSE;
  start_animation (notification);
}
Exemple #14
0
int AnimateBox::handle(int e) {
	int ret = Fl_Box::handle(e);
	if(!(flags & FLAG_ANIMATING_SHOW_HIDE)) return ret;

	switch(e) {
		case FL_SHOW:
			start_animation();
			E_DEBUG("starting animation\n");
			break;
		case FL_HIDE:
			stop_animation();
			break;
	}

	return ret;
}
Exemple #15
0
static bool
show_splash_screen (ply_boot_splash_plugin_t *plugin,
                    ply_event_loop_t         *loop,
                    ply_buffer_t             *boot_buffer,
                    ply_boot_splash_mode_t    mode)
{
  assert (plugin != NULL);
  assert (plugin->logo_image != NULL);

  plugin->loop = loop;
  plugin->mode = mode;

  ply_trace ("loading logo image");
  if (!ply_image_load (plugin->logo_image))
    return false;

  ply_trace ("loading lock image");
  if (!ply_image_load (plugin->lock_image))
    return false;

  ply_trace ("loading box image");
  if (!ply_image_load (plugin->box_image))
    return false;

  if (!load_views (plugin))
    {
      ply_trace ("couldn't load views");
      return false;
    }

  ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
                                 detach_from_event_loop,
                                 plugin);

  ply_event_loop_watch_signal (plugin->loop,
                               SIGINT,
                               (ply_event_handler_t) 
                               on_interrupt, plugin);

  ply_trace ("starting boot animation");
  start_animation (plugin);

  plugin->is_visible = true;

  return true;
}
Exemple #16
0
static bool
show_splash_screen (ply_boot_splash_plugin_t *plugin,
                    ply_event_loop_t         *loop,
                    ply_buffer_t             *boot_buffer,
                    ply_boot_splash_mode_t    mode)
{
        assert (plugin != NULL);

        plugin->loop = loop;
        plugin->mode = mode;
        ply_event_loop_watch_for_exit (loop, (ply_event_loop_exit_handler_t)
                                       detach_from_event_loop,
                                       plugin);

        ply_show_new_kernel_messages (false);
        start_animation (plugin);

        return true;
}
Exemple #17
0
void
gc_timer_pause(gboolean pause)
{
  if(boardRootItem==NULL)
    return;

  paused = pause;

  if(pause)
    {
      if (animate_id)
	g_source_remove (animate_id);
      animate_id = 0;

      if (subanimate_id)
	g_source_remove (subanimate_id);
      subanimate_id = 0;
    }
  else if(paused)
    {
      start_animation();
    }

}
Exemple #18
0
void set_and_start_animation(animation_names animation_by_name)
{
    stop_animation();
    set_animation(animation_by_name);
    start_animation();
}
void unit_animation_component::set_idling()
{
	display *disp = display::get_singleton();
	start_animation(INT_MAX, choose_animation(*disp, u_.loc_, "idling"),
		true, "", 0, STATE_FORGET);
}
Exemple #20
0
void
gc_timer_display(int ax, int ay,
		 TimerList atype, int second,
		 GcomprisTimerEnd agcomprisTimerEnd)
{
  GdkFont *gdk_font;
  GdkPixbuf *pixmap = NULL;
  GcomprisProperties *properties = gc_prop_get();

  /* Timer is user disabled */
  if(properties->timer==0)
    return;

  gdk_font = gdk_font_load (FONT_BOARD_MEDIUM);

  gc_timer_end();

  paused = FALSE;

  boardRootItem = goo_canvas_group_new (goo_canvas_get_root_item(gc_get_canvas()),
					NULL);

  x = ax;
  y = ay;
  second = second / properties->timer;
  timer = second;

  type = atype;
  gcomprisTimerEnd = agcomprisTimerEnd;

  switch(type)
    {
    case GCOMPRIS_TIMER_SAND:
    case GCOMPRIS_TIMER_CLOCK:
      {
	gchar		*filename = NULL;
	gint		fileid;

	fileid = (gint)timer;
	if(type==GCOMPRIS_TIMER_SAND)
	  filename = g_strdup_printf("timers/sablier%d.png", fileid);
	else
	  filename = g_strdup_printf("timers/clock%d.png", fileid);

	pixmap = gc_skin_pixmap_load(filename);

	gc_timer_item = goo_canvas_image_new (boardRootItem,
					      pixmap,
					      x,
					      y,
                          NULL);

#if GDK_PIXBUF_MAJOR <= 2 && GDK_PIXBUF_MINOR <= 24
	gdk_pixbuf_unref(pixmap);
#else
	g_object_unref(pixmap);
#endif
	g_free(filename);
      }
      break;
    case GCOMPRIS_TIMER_TEXT:
      {
	gchar *tmpstr = g_strdup_printf("Remaining Time = %d", timer);
	/* Display the value for this timer */
	gc_timer_item = goo_canvas_text_new (boardRootItem,
					     tmpstr,
					     x,
					     y,
					     -1,
					     GTK_ANCHOR_CENTER,
					     "font_gdk", gdk_font,
					     "fill_color", "white",
					     NULL);
	g_free(tmpstr);
      }
      break;
    case GCOMPRIS_TIMER_BALLOON:
      pixmap = gc_skin_pixmap_load("timers/tuxballoon.png");
      gc_timer_item = goo_canvas_image_new (boardRootItem,
					    pixmap,
					    x,
					    y,
					    NULL);

      /* Calc the number of step needed to reach
       * the sea based on user y and second
       */
      ystep = (BOARDHEIGHT-y-gdk_pixbuf_get_height(pixmap))/second;

#if GDK_PIXBUF_MAJOR <= 2 && GDK_PIXBUF_MINOR <= 24
      gdk_pixbuf_unref(pixmap);
#else
      g_object_unref(pixmap);
#endif

      pixmap = gc_skin_pixmap_load("timers/sea.png");
      goo_canvas_image_new (boardRootItem,
			    pixmap,
			    0,
			    BOARDHEIGHT - gdk_pixbuf_get_height(pixmap),
			    "width", (double) gdk_pixbuf_get_width(pixmap),
			    "height", (double) gdk_pixbuf_get_height(pixmap),
			    NULL);
#if GDK_PIXBUF_MAJOR <= 2 && GDK_PIXBUF_MINOR <= 24
      gdk_pixbuf_unref(pixmap);
#else
      g_object_unref(pixmap);
#endif

      break;
    default:
      break;
    }

  start_animation();
}
Exemple #21
0
int main(void)
{
	init();
	_delay_ms(100);
	_delay_ms(100);
	start_animation();
	_delay_ms(100);
	_delay_ms(100);
	_delay_ms(100);
	_delay_ms(100);
	_delay_ms(100);
	_delay_ms(100);
	_delay_ms(100);
	_delay_ms(100);
	cube_clear(); /* never forget this */

	while ( 1 )
	{	

        uart_puts("hallo welt");
		//usbPoll(); // Wird per Timer aufgerufen...
		if ( container.doAnimation != 0 )
		{
			switch ( container.doAnimation )
			{
				case 1 : ;
					cube_clear();
				break;
				case 2 : ;
					cube_full();
				break;
				
				// Equalizer
				case 20 : ;
					// euqalizer1 steuerung für mehrere ringe gleichzeitig
					cube_clear(); // aktuelles frame löschen
					switch ( container.eqValue )
					{
						case 10: ;
							equalizer_10();
						case  9: ;
							equalizer_9();
						case  8: ;
							equalizer_8();
						case  7: ;
							equalizer_7();
						case  6: ;
							equalizer_6();
						case  5: ;
							equalizer_5();
						case  4: ;
							equalizer_4();
						case  3: ;
							equalizer_3();
						case  2: ;
							equalizer_2();
						case  1: ;
							equalizer_1();
						case  0: ;
							equalizer_0();
					}
				break;
				case 21 : ;
					// euqalizer2 steuerung für mehrere ringe gleichzeitig
					cube_clear(); // aktuelles frame löschen
					switch ( container.eqValue )
					{
						case 10: ;
							equalizer_10();
						break;
						case  9: ;
							equalizer_9();
						break;
						case  8: ;
							equalizer_8();
						break;
						case  7: ;
							equalizer_7();
						break;
						case  6: ;
							equalizer_6();
						break;
						case  5: ;
							equalizer_5();
						break;
						case  4: ;
							equalizer_4();
						break;
						case  3: ;
							equalizer_3();
						break;
						case  2: ;
							equalizer_2();
						break;
						case  1: ;
							equalizer_1();
						break;
						case  0: ;
							equalizer_0();
						break;
					}
				break;
				case 30 : ;
					playAnimation = true;
					playAnimationen(maske1, aendrung1,frames1);
				break;
				case 31 : ;
					playAnimation = true;
					playAnimationen(maske2, aendrung2,frames2);
				break;
				case 32 : ;
					playAnimation = true;
					playAnimationen(maske3, aendrung3,frames3);
				break;
				case 33 : ;
					playAnimation = true;
					playAnimationen(maske4, aendrung4,frames4);
				break;
				case 34 : ;
					playAnimation = true;
					playAnimationen(maske5, aendrung5,frames5);
				break;
				case 35 : ;
					playAnimation = true;
					playAnimationen(maske6, aendrung6,frames6);
				break;
				case 36 : ;
					playAnimation = true;
					playAnimationen(maske7, aendrung7,frames7);
				break;
				case 37 : ;
					playAnimation = true;
					playAnimationen(maske8, aendrung8,frames8);
				break;
				case 38 : ;
					equalizer_8();
				break;
				case 39 : ;
					equalizer_9();
				break;
				case 40 : ;
					equalizer_10();
				break;
				// Laufschrift zeigen
				case 198 : ;
					showTime = true;
				break;
				// Laufschrift zeigen
				case 199 : ;
					boolPlayFloatingText = true;
					playFloatingText();
				break;
				// Startanimation zeigen
				case 200 : ;
					start_animation();
				break;
				case 255 : ; // Reset durchführen
					wdt_enable(0);
					while(1);
				break;
			}

			container.doAnimation = 0;

		}

	}

}