~ubuntu-branches/ubuntu/trusty/imagination/trusty-updates

« back to all changes in this revision

Viewing changes to src/imagination.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-05-12 07:19:02 UTC
  • Revision ID: james.westby@ubuntu.com-20090512071902-1qlldhv7rlfktvzl
Tags: upstream-1.0
Import upstream version 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (c) 2009 Giuseppe Torelli <colossus73@gmail.com>
 
3
 *  Copyright (c) 2009 Tadej Borovšak   <tadeboro@gmail.com>
 
4
 *
 
5
 *  This program is free software; you can redistribute it and/or modify
 
6
 *  it under the terms of the GNU General Public License as published by
 
7
 *  the Free Software Foundation; either version 2 of the License,or
 
8
 *  (at your option) any later version.
 
9
 *
 
10
 *  This program is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU Library General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with this program; if not,write to the Free Software
 
17
 *  Foundation,Inc.,59 Temple Place - Suite 330,Boston,MA 02111-1307,USA.
 
18
 *
 
19
 */
 
20
 
 
21
#ifndef __IMAGINATION_H__
 
22
#define __IMAGINATION_H__
 
23
 
 
24
#include <stdlib.h>
 
25
#include <gdk/gdkkeysyms.h>
 
26
#include <gtk/gtk.h>
 
27
 
 
28
/* Transition preview frame rate. I decided to use 25 fps, which
 
29
 * should be handled on time by most machines. */
 
30
#define PREVIEW_FPS 25
 
31
 
 
32
/* The transition speed is defined as a duration in seconds. */
 
33
#define FAST    1
 
34
#define NORMAL  4
 
35
#define SLOW    8
 
36
 
 
37
/* Export frame rate is currently set to 29.97. The intent of this
 
38
 * macro is to ease grepping through the sources if we decide to
 
39
 * implement different frame rates for different export formats.
 
40
 * Second macro is string representation of frame rate to be used
 
41
 * when constructing encoder command line. */
 
42
#define EXPORT_FPS         29.97
 
43
#define EXPORT_FPS_STRING "29.97"
 
44
 
 
45
#define comment_string  "Imagination 1.0 Slideshow Project - http://imagination.sf.net"
 
46
 
 
47
typedef struct _plugin plugin;
 
48
 
 
49
struct _plugin
 
50
{
 
51
        const gchar     *name;          /* The name of the transition */
 
52
        gpointer        address;        /* The mem address of the routine */
 
53
};
 
54
 
 
55
typedef struct _slide_struct slide_struct;
 
56
 
 
57
struct _slide_struct
 
58
{
 
59
        gchar   *filename;
 
60
        guint   duration;
 
61
        guint   speed;
 
62
        gchar   *resolution;
 
63
        gchar   *type;
 
64
        void    (*render) (GdkDrawable*, GdkPixbuf*, GdkPixbuf*, gdouble, gint);
 
65
        gint    combo_transition_type_index;
 
66
};
 
67
 
 
68
typedef struct _img_window_struct img_window_struct;
 
69
 
 
70
struct _img_window_struct
 
71
{
 
72
        /* Main GUI related variables */
 
73
        GtkWidget       *imagination_window;    // Main window
 
74
        GtkWidget       *open_menu;
 
75
        GtkWidget       *save_menu;
 
76
        GtkWidget       *save_as_menu;
 
77
        GtkWidget       *properties_menu;
 
78
        GtkWidget       *close_menu;
 
79
        GtkWidget       *open_button;
 
80
        GtkWidget       *save_button;
 
81
        GtkWidget       *import_menu;
 
82
        GtkWidget       *remove_menu;
 
83
        GtkWidget       *import_button;
 
84
        GtkWidget       *remove_button;
 
85
        GtkWidget       *preview_menu;
 
86
        GtkWidget       *preview_button;
 
87
        GtkWidget   *export_menu;
 
88
        GtkWidget   *export_button;
 
89
        GtkWidget       *transition_type;
 
90
        GtkWidget       *duration;                              // Duration spin button
 
91
        GtkWidget       *trans_duration;
 
92
        GtkWidget       *slide_selected_data;
 
93
        GtkWidget       *type_data;
 
94
        GtkWidget       *total_time_data;
 
95
        GtkWidget       *filename_data;
 
96
        GtkWidget       *resolution_data;
 
97
        GtkWidget       *thumb_scrolledwindow;
 
98
        GtkWidget       *thumbnail_iconview;
 
99
        GtkWidget       *statusbar;
 
100
        GtkWidget       *progress_bar;
 
101
        GtkWidget       *viewport;
 
102
        GtkWidget       *image_area;
 
103
        guint           context_id;
 
104
        GtkListStore *thumbnail_model;
 
105
        gchar           *current_dir;
 
106
 
 
107
        /* Import slides dialog variables */
 
108
        GtkWidget       *dim_label;
 
109
        GtkWidget       *size_label;
 
110
        GtkWidget       *preview_image;
 
111
 
 
112
        /* Renderers and module stuff */
 
113
        gint            nr_transitions_loaded;
 
114
        GSList          *plugin_list;
 
115
 
 
116
        /* Project related variables */
 
117
        gchar       *project_filename;          // project name for saving
 
118
        gchar           *slideshow_filename;    // exported file name
 
119
        gchar           *aspect_ratio;
 
120
        gboolean        distort_images;
 
121
        gboolean        project_is_modified;
 
122
        gint            slideshow_format_index;
 
123
        guint32     background_color;
 
124
        gint            total_secs;
 
125
        gint            slides_nr;
 
126
 
 
127
        /* Variables common to export and preview functions */
 
128
        slide_struct *current_slide;
 
129
        GdkPixbuf       *slide_pixbuf;
 
130
        GdkPixbuf       *pixbuf1;
 
131
        GdkPixbuf       *pixbuf2;
 
132
        GtkTreeIter *cur_ss_iter;
 
133
        guint           source_id;
 
134
        gdouble     progress;
 
135
 
 
136
        /* Preview related variables */
 
137
        gboolean        preview_is_running;
 
138
        GtkWidget       *import_slide_chooser;
 
139
        GtkWidget       *slide_number_entry;
 
140
 
 
141
        /* Export dialog related stuff */
 
142
        gboolean    export_is_running;
 
143
        gint        file_desc;
 
144
        guchar      *pixbuf_data;
 
145
        GtkWidget   *export_pbar1;
 
146
        GtkWidget   *export_pbar2;
 
147
        GtkWidget   *export_label;
 
148
        GtkWidget   *export_dialog;
 
149
        guint        export_frame_nr;   // Total number of frames
 
150
        guint        export_frame_cur;  // Current frame
 
151
        guint        export_slide_nr;   // Number of frames fo current slide
 
152
        guint        export_slide_cur;  // Current slide frame
 
153
        guint        export_slide;              // Number of slide being exported
 
154
        GSourceFunc  export_idle_func;  /* If TRUE, connect transition export,
 
155
                                                                           else still export function. */
 
156
};
 
157
 
 
158
#endif