⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 Swfdec is a decoder/renderer for Macromedia Flash animations. The decoding and rendering engine is
💻 C
字号:
/* Vivified * Copyright (C) 2007 Benjamin Otte <otte@gnome.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. *  * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Lesser General Public License for more details. *  * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor,  * Boston, MA  02110-1301  USA */#ifdef HAVE_CONFIG_H#include "config.h"#endif#include <gtk/gtk.h>#include <libswfdec-gtk/swfdec-gtk.h>#include "vivified/core/vivified-core.h"#include "vivified/dock/vivified-dock.h"static voidtry_grab_focus (GtkWidget *widget, gpointer unused){  if (GTK_IS_ENTRY (widget))    gtk_widget_grab_focus (widget);  else if (GTK_IS_CONTAINER (widget))    gtk_container_foreach (GTK_CONTAINER (widget), try_grab_focus, NULL);}static gbooleandelete_event (GtkWidget *widget, GdkEvent *event, ViviApplication *app){  if (!vivi_application_is_quit (app)) {    vivi_application_quit (app);    return TRUE;  }  return FALSE;}static voidset_title (ViviApplication *app, GParamSpec *pspec, GtkWindow *window){  const char *filename = vivi_application_get_filename (app);  if (filename == NULL)    filename = "Vivified";  gtk_window_set_title (window, filename);}static voidsetup (const char *filename, const char *variables){  GtkWidget *window, *box, *paned, *widget;  ViviApplication *app;  GtkBuilder *builder;  GError *error = NULL;  app = vivi_application_new ();  vivi_application_set_filename (app, filename);  vivi_application_set_variables (app, variables);  builder = gtk_builder_new ();  if (!gtk_builder_add_from_file (builder, "vivi_player.xml", &error) ||      !gtk_builder_add_from_file (builder, "vivi_command_line.xml", &error) ||      !gtk_builder_add_from_file (builder, "vivi_movies.xml", &error))    g_error ("%s", error->message);  gtk_builder_connect_signals (builder, app);  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);  gtk_window_set_default_size (GTK_WINDOW (window), 600, 450);  g_signal_connect_swapped (app, "notify::quit", G_CALLBACK (gtk_widget_destroy), window);  g_signal_connect (app, "notify::filename", G_CALLBACK (set_title), window);  set_title (app, NULL, GTK_WINDOW (window));  paned = gtk_hpaned_new ();  gtk_paned_set_position (GTK_PANED (paned), 200);  gtk_container_add (GTK_CONTAINER (window), paned);  box = vivi_vdock_new ();  gtk_paned_add2 (GTK_PANED (paned), box);  widget = GTK_WIDGET (gtk_builder_get_object (builder, "player"));  g_object_set (widget, "application", app, NULL);  vivi_vdock_add (VIVI_VDOCK (box), widget);  widget = GTK_WIDGET (gtk_builder_get_object (builder, "command-line"));  g_object_set (widget, "application", app, NULL);  vivi_vdock_add (VIVI_VDOCK (box), widget);  gtk_container_foreach (GTK_CONTAINER (widget), try_grab_focus, NULL);  box = vivi_vdock_new ();  gtk_paned_add1 (GTK_PANED (paned), box);  widget = GTK_WIDGET (gtk_builder_get_object (builder, "movies"));  g_object_set (widget, "application", app, NULL);  vivi_vdock_add (VIVI_VDOCK (box), widget);  g_signal_connect (window, "delete-event", G_CALLBACK (delete_event), app);  g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), app);  gtk_widget_show_all (window);  g_object_unref (builder);}intmain (int argc, char **argv){  gtk_init (&argc, &argv);  if (argc < 2) {    g_print ("usage: %s FILE [VARIABLES]\n", argv[0]);    return 0;  }  setup (argv[1], argc > 2 ? argv[2] : NULL);  gtk_main ();  return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -