[cheese/three-point-oh] reindent vala source code
- From: Daniel G. Siegel <dgsiegel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese/three-point-oh] reindent vala source code
- Date: Tue, 15 Jun 2010 13:02:36 +0000 (UTC)
commit b7c3a65a2b6213f473f8be8f05066ad9314fc841
Author: daniel g. siegel <dgsiegel gnome org>
Date: Tue Jun 15 15:01:21 2010 +0200
reindent vala source code
valasrc/cheese-countdown.vala | 38 +-
valasrc/cheese-main.vala | 184 ++++----
valasrc/cheese-window.vala | 858 +++++++++++++++++++-----------------
valasrc/vapi/cheese-common.vapi | 335 ++++++++-------
valasrc/vapi/cheese-thumbview.vapi | 20 +-
valasrc/vapi/config.vapi | 15 +-
valasrc/vapi/eogthumbnav.vapi | 26 +-
7 files changed, 776 insertions(+), 700 deletions(-)
---
diff --git a/valasrc/cheese-countdown.vala b/valasrc/cheese-countdown.vala
index 5abe8e3..01de967 100644
--- a/valasrc/cheese-countdown.vala
+++ b/valasrc/cheese-countdown.vala
@@ -3,39 +3,45 @@ using Clutter;
const int COUNTDOWN_START = 3;
-internal class Cheese.Countdown : GLib.Object {
-
- public delegate void CountdownCallback();
+internal class Cheese.Countdown : GLib.Object
+{
+ public delegate void CountdownCallback ();
private Clutter.Text countdown_actor;
+
private static CountdownCallback completed_callback;
private static int current_value = 0;
- public Countdown(Clutter.Text countdown_actor) {
+ public Countdown (Clutter.Text countdown_actor)
+ {
this.countdown_actor = countdown_actor;
}
- private void fade_out() {
- Clutter.Animation anim = this.countdown_actor.animate(Clutter.AnimationMode.LINEAR, 500, "opacity", 0);
- Signal.connect_after(anim, "completed", (GLib.Callback) fade_in, this);
+ private void fade_out ()
+ {
+ Clutter.Animation anim = this.countdown_actor.animate (Clutter.AnimationMode.LINEAR, 500, "opacity", 0);
+ Signal.connect_after (anim, "completed", (GLib.Callback)fade_in, this);
}
- private void fade_in() {
- if (this.current_value <= 0) {
- this.completed_callback();
+ private void fade_in ()
+ {
+ if (this.current_value <= 0)
+ {
+ this.completed_callback ();
return;
}
- this.countdown_actor.text = this.current_value.to_string();
+ this.countdown_actor.text = this.current_value.to_string ();
this.current_value--;
- Clutter.Animation anim = this.countdown_actor.animate(Clutter.AnimationMode.LINEAR, 500, "opacity", 255);
- Signal.connect_after(anim, "completed", (GLib.Callback) fade_out, this);
+ Clutter.Animation anim = this.countdown_actor.animate (Clutter.AnimationMode.LINEAR, 500, "opacity", 255);
+ Signal.connect_after (anim, "completed", (GLib.Callback)fade_out, this);
}
- public void start_countdown (CountdownCallback completed_callback) {
+ public void start_countdown (CountdownCallback completed_callback)
+ {
this.completed_callback = completed_callback;
- this.current_value = COUNTDOWN_START;
- fade_in();
+ this.current_value = COUNTDOWN_START;
+ fade_in ();
}
}
diff --git a/valasrc/cheese-main.vala b/valasrc/cheese-main.vala
index 132dddb..38ab637 100644
--- a/valasrc/cheese-main.vala
+++ b/valasrc/cheese-main.vala
@@ -4,92 +4,100 @@ using Clutter;
using Gst;
using Unique;
-public class Cheese.Main {
- static bool verbose;
- static bool wide;
- static bool version_only;
- static FileStream log_file;
-
- static Cheese.MainWindow main_window;
-
- const OptionEntry[] options = {
- { "verbose", 'v', 0, OptionArg.NONE, ref verbose, N_("Be verbose"), null},
- { "wide", 'w', 0, OptionArg.NONE, ref wide, N_("Enable wide mode"), null},
- { "version", 0, 0, OptionArg.NONE, ref version_only, N_("Output version information and exit"), null},
- { null }
- };
-
- static void print_handler (string text) {
- log_file.puts (text);
- if (verbose) {
- stdout.puts (text);
- }
- }
-
- public static Unique.Response unique_message_received(int command,
- Unique.MessageData msg,
- uint time) {
- Unique.Response res;
- if (command == Unique.Command.ACTIVATE) {
- main_window.set_screen(msg.get_screen());
- main_window.activate();
- }
- return Unique.Response.OK;
- }
-
- public static int main (string[] args) {
-
-
- Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.PACKAGE_LOCALEDIR);
- Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
- Intl.textdomain (Config.GETTEXT_PACKAGE);
-
- Gtk.init(ref args);
- Clutter.init(ref args);
-
- try {
- var context = new OptionContext (_("- Take photos and videos from your webcam"));
- context.set_help_enabled (true);
- context.add_main_entries (options, null);
- context.add_group (Gtk.get_option_group (true));
- context.add_group (Clutter.get_option_group ());
- context.add_group (Gst.init_get_option_group ());
- context.parse (ref args);
- } catch (OptionError e) {
- stdout.printf ("%s\n", e.message);
- stdout.printf (_("Run '%s --help' to see a full list of available command line options.\n"), args[0]);
- return 1;
- }
-
- main_window = new Cheese.MainWindow();
-
- Unique.App app = new Unique.App("org.gnome.Cheese", null);
- if (app.is_running) {
- Unique.Response response;
- response = app.send_message(Unique.Command.ACTIVATE, null);
- return 0;
- }
- else {
- app.watch_window(main_window);
- app.message_received.connect(unique_message_received);
- }
-
- Environment.set_application_name (_("Cheese"));
- Window.set_default_icon_name ("cheese");
-
- string log_file_dir = GLib.Path.build_filename (Environment.get_home_dir(), ".config", "cheese");
- DirUtils.create_with_parents (log_file_dir, 0775);
- log_file = FileStream.open (GLib.Path.build_filename (log_file_dir, "cheese.log"), "w");
- set_print_handler (print_handler);
-
- Gtk.IconTheme.get_default().append_search_path(GLib.Path.build_filename (Config.PACKAGE_DATADIR, "icons"));
-
- main_window.setup_ui();
- main_window.destroy.connect(Gtk.main_quit);
- main_window.show_all();
-
- Gtk.main ();
-
- return 0;
- }
+public class Cheese.Main
+{
+ static bool verbose;
+ static bool wide;
+ static bool version_only;
+ static FileStream log_file;
+
+ static Cheese.MainWindow main_window;
+
+ const OptionEntry[] options = {
+ {"verbose", 'v', 0, OptionArg.NONE, ref verbose, N_("Be verbose"), null},
+ {"wide", 'w', 0, OptionArg.NONE, ref wide, N_("Enable wide mode"), null},
+ {"version", 0, 0, OptionArg.NONE, ref version_only, N_("Output version information and exit"), null},
+ {null}
+ };
+
+ static void print_handler (string text)
+ {
+ log_file.puts (text);
+ if (verbose)
+ {
+ stdout.puts (text);
+ }
+ }
+
+ public static Unique.Response unique_message_received (int command,
+ Unique.MessageData msg,
+ uint time)
+ {
+ Unique.Response res;
+ if (command == Unique.Command.ACTIVATE)
+ {
+ main_window.set_screen (msg.get_screen ());
+ main_window.activate ();
+ }
+ return Unique.Response.OK;
+ }
+
+ public static int main (string[] args)
+ {
+ Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.PACKAGE_LOCALEDIR);
+ Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
+ Intl.textdomain (Config.GETTEXT_PACKAGE);
+
+ Gtk.init (ref args);
+ Clutter.init (ref args);
+
+ try {
+ var context = new OptionContext (_("- Take photos and videos from your webcam"));
+ context.set_help_enabled (true);
+ context.add_main_entries (options, null);
+ context.add_group (Gtk.get_option_group (true));
+ context.add_group (Clutter.get_option_group ());
+ context.add_group (Gst.init_get_option_group ());
+ context.parse (ref args);
+ }
+ catch (OptionError e)
+ {
+ stdout.printf ("%s\n", e.message);
+ stdout.printf (_("Run '%s --help' to see a full list of available command line options.\n"), args[0]);
+ return 1;
+ }
+
+ main_window = new Cheese.MainWindow ();
+
+ Unique.App app = new Unique.App ("org.gnome.Cheese", null);
+ if (app.is_running)
+ {
+ Unique.Response response;
+ response = app.send_message (Unique.Command.ACTIVATE, null);
+ return 0;
+ }
+ else
+ {
+ app.watch_window (main_window);
+ app.message_received.connect (unique_message_received);
+ }
+
+ Environment.set_application_name (_("Cheese"));
+ Window.set_default_icon_name ("cheese");
+
+ string log_file_dir = GLib.Path.build_filename (Environment.get_home_dir (), ".config", "cheese");
+ DirUtils.create_with_parents (log_file_dir, 0775);
+ log_file = FileStream.open (GLib.Path.build_filename (log_file_dir, "cheese.log"), "w");
+ set_print_handler (print_handler);
+
+ Gtk.IconTheme.get_default ().append_search_path (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "icons"));
+
+ main_window.setup_ui ();
+ main_window.destroy.connect (Gtk.main_quit);
+ main_window.show_all ();
+
+ Gtk.main ();
+
+ return 0;
+ }
}
diff --git a/valasrc/cheese-window.vala b/valasrc/cheese-window.vala
index 6b490a0..2f1bc9e 100644
--- a/valasrc/cheese-window.vala
+++ b/valasrc/cheese-window.vala
@@ -7,410 +7,456 @@ using Eog;
using Gst;
const int FULLSCREEN_TIMEOUT_INTERVAL = 5 * 1000;
-public class Cheese.MainWindow : Gtk.Window {
-
- private MediaMode current_mode;
-
- private Gtk.Builder gtk_builder;
- private Clutter.Script clutter_builder;
-
- private Gtk.Widget thumbnails;
- private GtkClutter.Embed viewport_widget;
- private Gtk.VBox main_vbox;
- private Eog.ThumbNav thumb_nav;
- private Cheese.ThumbView thumb_view;
- private Gtk.Frame thumbnails_right;
- private Gtk.Frame thumbnails_bottom;
- private Gtk.MenuBar menubar;
- private Gtk.HBox leave_fullscreen_button_container;
- private Gtk.ToggleButton photo_toggle_button;
- private Gtk.ToggleButton video_toggle_button;
- private Gtk.ToggleButton burst_toggle_button;
- private Gtk.Button take_action_button;
- private Gtk.Label take_action_button_label;
- private Gtk.Image take_action_button_image;
- private Gtk.ToggleButton effects_toggle_button;
- private Gtk.Button leave_fullscreen_button;
- private Gtk.HBox buttons_area;
-
- private Clutter.Stage viewport;
- private Clutter.Box viewport_layout;
- private Clutter.Texture video_preview;
- private Clutter.BinLayout viewport_layout_manager;
- private Clutter.Text countdown_layer;
-
- private Gtk.Action take_photo_action;
- private Gtk.Action take_video_action;
- private Gtk.Action take_burst_action;
- private Gtk.Action photo_mode_action;
- private Gtk.Action video_mode_action;
- private Gtk.Action burst_mode_action;
- private Gtk.Action effects_toggle_action;
-
- private bool is_fullscreen;
- private bool is_wide_mode;
- private bool is_recording; // Video Recording Flag
- private bool is_bursting;
-
- private Gtk.Button[] buttons;
-
- private Cheese.Camera camera;
- private Cheese.FileUtil fileutil;
- private Cheese.Flash flash;
- private Cheese.GConf conf;
-
- [CCode (instance_pos = -1)]
- internal void on_quit (Action action ) {
- destroy();
- }
-
- [CCode (instance_pos = -1)]
- internal void on_help_contents (Action action ) {
- Gdk.Screen screen;
- screen = this.get_screen();
- Gtk.show_uri(screen, "ghelp:cheese", Gtk.get_current_event_time());
- }
-
- [CCode (instance_pos = -1)]
- internal void on_help_about (Action action) {
- // FIXME: Close doesn't work
- // FIXME: Clicking URL In the License dialog borks.
- Gtk.AboutDialog about_dialog;
- about_dialog = (Gtk.AboutDialog) gtk_builder.get_object("aboutdialog");
- about_dialog.version = Config.VERSION;
- about_dialog.show_all();
- }
-
- [CCode (instance_pos = -1)]
- internal void on_layout_wide_mode (ToggleAction action ) {
- set_wide_mode(action.active);
- }
-
- [CCode (instance_pos = -1)]
- internal void on_layout_fullscreen (ToggleAction action ) {
- set_fullscreen_mode(action.active);
- }
-
- [CCode (instance_pos = -1)]
- internal void on_mode_change(RadioAction action) {
- set_mode((MediaMode)action.value);
- }
-
- private void enable_mode_change() {
- photo_mode_action.sensitive = true;
- video_mode_action.sensitive = true;
- burst_mode_action.sensitive = true;
- }
-
- private void disable_mode_change() {
- switch(this.current_mode) {
- case MediaMode.PHOTO:
- photo_mode_action.sensitive = true;
- video_mode_action.sensitive = false;
- burst_mode_action.sensitive = false;
- break;
- case MediaMode.VIDEO:
- photo_mode_action.sensitive = false;
- video_mode_action.sensitive = true;
- burst_mode_action.sensitive = false;
- break;
- case MediaMode.BURST:
- photo_mode_action.sensitive = false;
- video_mode_action.sensitive = false;
- burst_mode_action.sensitive = true;
- break;
- }
- }
-
- private void set_mode(MediaMode mode) {
- this.current_mode = mode;
- switch(this.current_mode) {
- case MediaMode.PHOTO:
- take_photo_action.sensitive = true;
- take_video_action.sensitive = false;
- take_burst_action.sensitive = false;
- take_action_button.related_action = take_photo_action;
- break;
- case MediaMode.VIDEO:
- take_photo_action.sensitive = false;
- take_video_action.sensitive = true;
- take_burst_action.sensitive = false;
- take_action_button.related_action = take_video_action;
- break;
- case MediaMode.BURST:
- take_photo_action.sensitive = false;
- take_video_action.sensitive = false;
- take_burst_action.sensitive = true;
- take_action_button.related_action = take_burst_action;
- break;
- }
- take_action_button_label.label = "<b>" + take_action_button.related_action.label + "</b>";
- }
-
- private TimeoutSource fullscreen_timeout;
- private void clear_fullscreen_timeout() {
- if (fullscreen_timeout != null) {
- fullscreen_timeout.destroy();
- fullscreen_timeout = null;
- }
- }
-
- private void set_fullscreen_timeout () {
- fullscreen_timeout = new TimeoutSource(FULLSCREEN_TIMEOUT_INTERVAL);
- fullscreen_timeout.attach (null);
- fullscreen_timeout.set_callback(() => { buttons_area.hide();
- clear_fullscreen_timeout();
- return true;});
- }
-
- private bool fullscreen_motion_notify_callback(Gtk.Widget viewport, EventMotion e) {
- // Start a new timeout at the end of every mouse pointer movement.
- // So all timeouts will be cancelled, except one at the last pointer movement.
- // We call show even if the button isn't hidden.
- clear_fullscreen_timeout();
- buttons_area.show();
- set_fullscreen_timeout();
- return true;
- }
-
- private void set_fullscreen_mode(bool fullscreen_mode) {
- // After the first time the window has been shown using this.show_all(),
- // the value of leave_fullscreen_button_container.no_show_all should be set to false
- // So that the next time leave_fullscreen_button_container.show_all() is called, the button is actually shown
- // FIXME: If this code can be made cleaner/clearer, please do
-
- is_fullscreen = fullscreen_mode;
- if (fullscreen_mode) {
- if (is_wide_mode) {
- thumbnails_right.hide_all();
- }
- else {
- thumbnails_bottom.hide_all();
- }
- menubar.hide_all();
- leave_fullscreen_button_container.no_show_all = false;
- leave_fullscreen_button_container.show_all();
-
- // Make all buttons look 'flat'
- foreach (Gtk.Button b in buttons) {
- b.relief = Gtk.ReliefStyle.NONE;
- }
- this.fullscreen();
- viewport_widget.motion_notify_event.connect(fullscreen_motion_notify_callback);
- set_fullscreen_timeout();
- }
- else {
- if (is_wide_mode) {
- thumbnails_right.show_all();
- }
- else {
- thumbnails_bottom.show_all();
- }
- menubar.show_all();
- leave_fullscreen_button_container.hide_all();
-
- // Make all buttons look, uhm, Normal
- foreach (Gtk.Button b in buttons) {
- b.relief = Gtk.ReliefStyle.NORMAL;
- }
- // Show the buttons area anyway - it might've been hidden in fullscreen mode
- buttons_area.show();
- viewport_widget.motion_notify_event.disconnect(fullscreen_motion_notify_callback);
- this.unfullscreen();
- }
- }
-
- private void set_wide_mode(bool wide_mode, bool initialize=false) {
- is_wide_mode = wide_mode;
- if (!initialize) {
- // Sets requested size of the viewport_widget to be it's current size
- // So it does not grow smaller with each toggle
- Gtk.Allocation alloc;
- viewport_widget.get_allocation(out alloc);
- viewport_widget.set_size_request(alloc.width, alloc.height);
- }
-
- if (is_wide_mode) {
- thumb_view.set_columns(1);
- thumb_nav.set_vertical(true);
- if (thumbnails_bottom.get_child() != null)
- {
- thumbnails_bottom.remove(thumb_nav);
- }
- thumbnails_right.add(thumb_nav);
- thumbnails_right.resize_children();
- thumbnails_right.show_all();
- thumbnails_bottom.hide_all();
- }
- else {
- thumb_view.set_columns(5000);
- thumb_nav.set_vertical(false);
- if (thumbnails_right.get_child() != null)
- {
- thumbnails_right.remove(thumb_nav);
- }
- thumbnails_bottom.add(thumb_nav);
- thumbnails_bottom.resize_children();
- thumbnails_right.hide_all();
- thumbnails_bottom.show_all();
-
- }
-
- if(!initialize) {
- // Makes sure that the window is the size it ought to be, and no bigger/smaller
- // Used to make sure that the viewport_widget does not keep growing with each toggle
- Gtk.Requisition req;
- this.size_request(out req);
- this.resize(req.width, req.height);
- }
- }
-
- // To make sure that the layout manager manages the entire stage.
- internal void on_stage_resize(Clutter.Actor actor,
- Clutter.ActorBox box,
- Clutter.AllocationFlags flags)
- {
- this.viewport_layout.set_size(viewport.width, viewport.height);
- }
-
-
- private void finish_countdown_callback() {
- string file_name = fileutil.get_new_media_filename(this.current_mode);
- this.flash.fire();
- this.camera.take_photo(file_name);
- }
-
- internal void take_photo() {
- Countdown cd = new Countdown(this.countdown_layer);
- cd.start_countdown(finish_countdown_callback);
- }
-
- private int burst_count;
-
- private bool burst_take_photo() {
- if (is_bursting && burst_count < 3) {
- this.take_photo();
- burst_count++;
- return true;
- }
- else {
- is_bursting = false;
- this.enable_mode_change();
- take_action_button.related_action.sensitive = true;
- effects_toggle_action.sensitive = true;
- burst_count = 0;
- fileutil.reset_burst();
- return false;
- }
- }
-
-
- [CCode (instance_pos = -1)]
- internal void on_take_action (Action action ) {
- if (current_mode == MediaMode.PHOTO) {
- this.take_photo();
- }
- else if (current_mode == MediaMode.VIDEO) {
- if (!is_recording) {
- camera.start_video_recording (fileutil.get_new_media_filename(this.current_mode));
- take_action_button_label.label = "<b>Stop _Recording</b>";
- take_action_button_image.set_from_stock(Gtk.STOCK_MEDIA_STOP, Gtk.IconSize.BUTTON);
- this.is_recording = true;
- this.disable_mode_change();
- effects_toggle_action.sensitive = false;
- }
- else {
- camera.stop_video_recording();
- take_action_button_label.label = "<b>" + take_action_button.related_action.label + "</b>";
- take_action_button_image.set_from_stock(Gtk.STOCK_MEDIA_RECORD, Gtk.IconSize.BUTTON);
- this.is_recording = false;
- this.enable_mode_change();
- effects_toggle_action.sensitive = true;
- }
- }
- else if (current_mode == MediaMode.BURST) {
- is_bursting = true;
- this.disable_mode_change();
- take_action_button.related_action.sensitive = false;
- effects_toggle_action.sensitive = false;
- burst_take_photo();
- GLib.Timeout.add(3500, burst_take_photo);
- }
- }
-
- public void setup_ui () {
- gtk_builder = new Gtk.Builder();
- clutter_builder = new Clutter.Script();
- fileutil = new FileUtil();
- flash = new Flash(this);
-
- gtk_builder.add_from_file (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "cheese-actions.ui"));
- gtk_builder.add_from_file (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "cheese-about.ui"));
- gtk_builder.add_from_file (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "cheese-main-window.ui"));
- gtk_builder.connect_signals(this);
-
- clutter_builder.load_from_file (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "cheese-viewport.json"));
-
- main_vbox = (VBox) gtk_builder.get_object ("mainbox_normal");
- thumbnails = (Widget) gtk_builder.get_object("thumbnails");
- viewport_widget = (GtkClutter.Embed) gtk_builder.get_object("viewport");
- viewport = (Clutter.Stage) viewport_widget.get_stage();
- thumbnails_right = (Frame) gtk_builder.get_object("thumbnails_right");
- thumbnails_bottom = (Frame) gtk_builder.get_object("thumbnails_bottom");
- menubar = (Gtk.MenuBar) gtk_builder.get_object("main_menubar");
- leave_fullscreen_button_container = (Gtk.HBox) gtk_builder.get_object("leave_fullscreen_button_bin");
- photo_toggle_button = (Gtk.ToggleButton) gtk_builder.get_object("photo_toggle_button");
- video_toggle_button = (Gtk.ToggleButton) gtk_builder.get_object("video_toggle_button");
- burst_toggle_button = (Gtk.ToggleButton) gtk_builder.get_object("burst_toggle_button");
- take_action_button = (Gtk.Button) gtk_builder.get_object("take_action_button");
- take_action_button_label = (Gtk.Label) gtk_builder.get_object("take_action_button_internal_label");
- take_action_button_image = (Gtk.Image) gtk_builder.get_object("take_action_button_internal_image");
- effects_toggle_button = (Gtk.ToggleButton) gtk_builder.get_object("effects_toggle_button");
- leave_fullscreen_button = (Gtk.Button) gtk_builder.get_object("leave_fullscreen_button");
- buttons_area = (Gtk.HBox) gtk_builder.get_object("buttons_area");
-
- take_photo_action = (Gtk.Action) gtk_builder.get_object("take_photo");
- take_video_action = (Gtk.Action) gtk_builder.get_object("take_video");;
- take_burst_action = (Gtk.Action) gtk_builder.get_object("take_burst");;
- photo_mode_action = (Gtk.Action) gtk_builder.get_object("photo_mode");
- video_mode_action = (Gtk.Action) gtk_builder.get_object("video_mode");;
- burst_mode_action = (Gtk.Action) gtk_builder.get_object("burst_mode");;
- effects_toggle_action = (Gtk.Action) gtk_builder.get_object("effects_toggle");
-
- // Array contains all 'buttons', for easier manipulation
- // IMPORTANT: IF ANOTHER BUTTON IS ADDED UNDER THE VIEWPORT, ADD IT TO THIS ARRAY
- buttons = {photo_toggle_button,
- video_toggle_button,
- burst_toggle_button,
- take_action_button,
- effects_toggle_button,
- leave_fullscreen_button};
-
- video_preview = (Clutter.Texture) clutter_builder.get_object ("video_preview");
- viewport_layout = (Clutter.Box) clutter_builder.get_object ("viewport_layout");
- viewport_layout_manager = (Clutter.BinLayout) clutter_builder.get_object ("viewport_layout_manager");
- countdown_layer = (Clutter.Text) clutter_builder.get_object ("countdown_layer");
-
- viewport_layout.set_layout_manager(viewport_layout_manager);
-
- camera = new Camera(video_preview, "/dev/video0", 1024, 768);
-
- viewport.add_actor(viewport_layout);
-
- viewport.allocation_changed.connect(on_stage_resize);
-
- thumb_view = new Cheese.ThumbView();
- thumb_nav = new Eog.ThumbNav(thumb_view, false);
-
- viewport.show_all();
-
- camera.setup(conf.camera);
- camera.play();
-
- set_wide_mode(true, true);
- set_mode(MediaMode.PHOTO);
-
- this.add(main_vbox);
-
- }
+public class Cheese.MainWindow : Gtk.Window
+{
+ private MediaMode current_mode;
+
+ private Gtk.Builder gtk_builder;
+ private Clutter.Script clutter_builder;
+
+ private Gtk.Widget thumbnails;
+ private GtkClutter.Embed viewport_widget;
+ private Gtk.VBox main_vbox;
+ private Eog.ThumbNav thumb_nav;
+ private Cheese.ThumbView thumb_view;
+ private Gtk.Frame thumbnails_right;
+ private Gtk.Frame thumbnails_bottom;
+ private Gtk.MenuBar menubar;
+ private Gtk.HBox leave_fullscreen_button_container;
+ private Gtk.ToggleButton photo_toggle_button;
+ private Gtk.ToggleButton video_toggle_button;
+ private Gtk.ToggleButton burst_toggle_button;
+ private Gtk.Button take_action_button;
+ private Gtk.Label take_action_button_label;
+ private Gtk.Image take_action_button_image;
+ private Gtk.ToggleButton effects_toggle_button;
+ private Gtk.Button leave_fullscreen_button;
+ private Gtk.HBox buttons_area;
+
+ private Clutter.Stage viewport;
+ private Clutter.Box viewport_layout;
+ private Clutter.Texture video_preview;
+ private Clutter.BinLayout viewport_layout_manager;
+ private Clutter.Text countdown_layer;
+
+ private Gtk.Action take_photo_action;
+ private Gtk.Action take_video_action;
+ private Gtk.Action take_burst_action;
+ private Gtk.Action photo_mode_action;
+ private Gtk.Action video_mode_action;
+ private Gtk.Action burst_mode_action;
+ private Gtk.Action effects_toggle_action;
+
+ private bool is_fullscreen;
+ private bool is_wide_mode;
+ private bool is_recording; /* Video Recording Flag */
+ private bool is_bursting;
+
+ private Gtk.Button[] buttons;
+
+ private Cheese.Camera camera;
+ private Cheese.FileUtil fileutil;
+ private Cheese.Flash flash;
+ private Cheese.GConf conf;
+
+ [CCode (instance_pos = -1)]
+ internal void on_quit (Action action)
+ {
+ destroy ();
+ }
+
+ [CCode (instance_pos = -1)]
+ internal void on_help_contents (Action action)
+ {
+ Gdk.Screen screen;
+ screen = this.get_screen ();
+ Gtk.show_uri (screen, "ghelp:cheese", Gtk.get_current_event_time ());
+ }
+
+ [CCode (instance_pos = -1)]
+ internal void on_help_about (Action action)
+ {
+ /* FIXME: Close doesn't work
+ * FIXME: Clicking URL In the License dialog borks. */
+ Gtk.AboutDialog about_dialog;
+ about_dialog = (Gtk.AboutDialog)gtk_builder.get_object ("aboutdialog");
+ about_dialog.version = Config.VERSION;
+ about_dialog.show_all ();
+ }
+
+ [CCode (instance_pos = -1)]
+ internal void on_layout_wide_mode (ToggleAction action)
+ {
+ set_wide_mode (action.active);
+ }
+
+ [CCode (instance_pos = -1)]
+ internal void on_layout_fullscreen (ToggleAction action)
+ {
+ set_fullscreen_mode (action.active);
+ }
+
+ [CCode (instance_pos = -1)]
+ internal void on_mode_change (RadioAction action)
+ {
+ set_mode ((MediaMode) action.value);
+ }
+
+ private void enable_mode_change ()
+ {
+ photo_mode_action.sensitive = true;
+ video_mode_action.sensitive = true;
+ burst_mode_action.sensitive = true;
+ }
+
+ private void disable_mode_change ()
+ {
+ switch (this.current_mode)
+ {
+ case MediaMode.PHOTO:
+ photo_mode_action.sensitive = true;
+ video_mode_action.sensitive = false;
+ burst_mode_action.sensitive = false;
+ break;
+
+ case MediaMode.VIDEO:
+ photo_mode_action.sensitive = false;
+ video_mode_action.sensitive = true;
+ burst_mode_action.sensitive = false;
+ break;
+
+ case MediaMode.BURST:
+ photo_mode_action.sensitive = false;
+ video_mode_action.sensitive = false;
+ burst_mode_action.sensitive = true;
+ break;
+ }
+ }
+
+ private void set_mode (MediaMode mode)
+ {
+ this.current_mode = mode;
+ switch (this.current_mode)
+ {
+ case MediaMode.PHOTO:
+ take_photo_action.sensitive = true;
+ take_video_action.sensitive = false;
+ take_burst_action.sensitive = false;
+ take_action_button.related_action = take_photo_action;
+ break;
+
+ case MediaMode.VIDEO:
+ take_photo_action.sensitive = false;
+ take_video_action.sensitive = true;
+ take_burst_action.sensitive = false;
+ take_action_button.related_action = take_video_action;
+ break;
+
+ case MediaMode.BURST:
+ take_photo_action.sensitive = false;
+ take_video_action.sensitive = false;
+ take_burst_action.sensitive = true;
+ take_action_button.related_action = take_burst_action;
+ break;
+ }
+ take_action_button_label.label = "<b>" + take_action_button.related_action.label + "</b>";
+ }
+
+ private TimeoutSource fullscreen_timeout;
+ private void clear_fullscreen_timeout ()
+ {
+ if (fullscreen_timeout != null)
+ {
+ fullscreen_timeout.destroy ();
+ fullscreen_timeout = null;
+ }
+ }
+
+ private void set_fullscreen_timeout ()
+ {
+ fullscreen_timeout = new TimeoutSource (FULLSCREEN_TIMEOUT_INTERVAL);
+ fullscreen_timeout.attach (null);
+ fullscreen_timeout.set_callback (() => {buttons_area.hide ();
+ clear_fullscreen_timeout ();
+ return true;});
+ }
+
+ private bool fullscreen_motion_notify_callback (Gtk.Widget viewport, EventMotion e)
+ {
+ /* Start a new timeout at the end of every mouse pointer movement.
+ * So all timeouts will be cancelled, except one at the last pointer movement.
+ * We call show even if the button isn't hidden. */
+ clear_fullscreen_timeout ();
+ buttons_area.show ();
+ set_fullscreen_timeout ();
+ return true;
+ }
+
+ private void set_fullscreen_mode (bool fullscreen_mode)
+ {
+ /* After the first time the window has been shown using this.show_all(),
+ * the value of leave_fullscreen_button_container.no_show_all should be set to false
+ * So that the next time leave_fullscreen_button_container.show_all() is called, the button is actually shown
+ * FIXME: If this code can be made cleaner/clearer, please do */
+
+ is_fullscreen = fullscreen_mode;
+ if (fullscreen_mode)
+ {
+ if (is_wide_mode)
+ {
+ thumbnails_right.hide_all ();
+ }
+ else
+ {
+ thumbnails_bottom.hide_all ();
+ }
+ menubar.hide_all ();
+ leave_fullscreen_button_container.no_show_all = false;
+ leave_fullscreen_button_container.show_all ();
+
+ /* Make all buttons look 'flat' */
+ foreach (Gtk.Button b in buttons)
+ {
+ b.relief = Gtk.ReliefStyle.NONE;
+ }
+ this.fullscreen ();
+ viewport_widget.motion_notify_event.connect (fullscreen_motion_notify_callback);
+ set_fullscreen_timeout ();
+ }
+ else
+ {
+ if (is_wide_mode)
+ {
+ thumbnails_right.show_all ();
+ }
+ else
+ {
+ thumbnails_bottom.show_all ();
+ }
+ menubar.show_all ();
+ leave_fullscreen_button_container.hide_all ();
+
+ /* Make all buttons look, uhm, Normal */
+ foreach (Gtk.Button b in buttons)
+ {
+ b.relief = Gtk.ReliefStyle.NORMAL;
+ }
+
+ /* Show the buttons area anyway - it might've been hidden in fullscreen mode */
+ buttons_area.show ();
+ viewport_widget.motion_notify_event.disconnect (fullscreen_motion_notify_callback);
+ this.unfullscreen ();
+ }
+ }
+
+ private void set_wide_mode (bool wide_mode, bool initialize = false)
+ {
+ is_wide_mode = wide_mode;
+ if (!initialize)
+ {
+ /* Sets requested size of the viewport_widget to be it's current size
+ * So it does not grow smaller with each toggle */
+ Gtk.Allocation alloc;
+ viewport_widget.get_allocation (out alloc);
+ viewport_widget.set_size_request (alloc.width, alloc.height);
+ }
+
+ if (is_wide_mode)
+ {
+ thumb_view.set_columns (1);
+ thumb_nav.set_vertical (true);
+ if (thumbnails_bottom.get_child () != null)
+ {
+ thumbnails_bottom.remove (thumb_nav);
+ }
+ thumbnails_right.add (thumb_nav);
+ thumbnails_right.resize_children ();
+ thumbnails_right.show_all ();
+ thumbnails_bottom.hide_all ();
+ }
+ else
+ {
+ thumb_view.set_columns (5000);
+ thumb_nav.set_vertical (false);
+ if (thumbnails_right.get_child () != null)
+ {
+ thumbnails_right.remove (thumb_nav);
+ }
+ thumbnails_bottom.add (thumb_nav);
+ thumbnails_bottom.resize_children ();
+ thumbnails_right.hide_all ();
+ thumbnails_bottom.show_all ();
+ }
+
+ if (!initialize)
+ {
+ /* Makes sure that the window is the size it ought to be, and no bigger/smaller
+ * Used to make sure that the viewport_widget does not keep growing with each toggle */
+ Gtk.Requisition req;
+ this.size_request (out req);
+ this.resize (req.width, req.height);
+ }
+ }
+
+ /* To make sure that the layout manager manages the entire stage. */
+ internal void on_stage_resize (Clutter.Actor actor,
+ Clutter.ActorBox box,
+ Clutter.AllocationFlags flags)
+ {
+ this.viewport_layout.set_size (viewport.width, viewport.height);
+ }
+
+ private void finish_countdown_callback ()
+ {
+ string file_name = fileutil.get_new_media_filename (this.current_mode);
+
+ this.flash.fire ();
+ this.camera.take_photo (file_name);
+ }
+
+ internal void take_photo ()
+ {
+ Countdown cd = new Countdown (this.countdown_layer);
+
+ cd.start_countdown (finish_countdown_callback);
+ }
+
+ private int burst_count;
+
+ private bool burst_take_photo ()
+ {
+ if (is_bursting && burst_count < 3)
+ {
+ this.take_photo ();
+ burst_count++;
+ return true;
+ }
+ else
+ {
+ is_bursting = false;
+ this.enable_mode_change ();
+ take_action_button.related_action.sensitive = true;
+ effects_toggle_action.sensitive = true;
+ burst_count = 0;
+ fileutil.reset_burst ();
+ return false;
+ }
+ }
+
+ [CCode (instance_pos = -1)]
+ internal void on_take_action (Action action)
+ {
+ if (current_mode == MediaMode.PHOTO)
+ {
+ this.take_photo ();
+ }
+ else
+ if (current_mode == MediaMode.VIDEO)
+ {
+ if (!is_recording)
+ {
+ camera.start_video_recording (fileutil.get_new_media_filename (this.current_mode));
+ take_action_button_label.label = "<b>Stop _Recording</b>";
+ take_action_button_image.set_from_stock (Gtk.STOCK_MEDIA_STOP, Gtk.IconSize.BUTTON);
+ this.is_recording = true;
+ this.disable_mode_change ();
+ effects_toggle_action.sensitive = false;
+ }
+ else
+ {
+ camera.stop_video_recording ();
+ take_action_button_label.label = "<b>" + take_action_button.related_action.label + "</b>";
+ take_action_button_image.set_from_stock (Gtk.STOCK_MEDIA_RECORD, Gtk.IconSize.BUTTON);
+ this.is_recording = false;
+ this.enable_mode_change ();
+ effects_toggle_action.sensitive = true;
+ }
+ }
+ else
+ if (current_mode == MediaMode.BURST)
+ {
+ is_bursting = true;
+ this.disable_mode_change ();
+ take_action_button.related_action.sensitive = false;
+ effects_toggle_action.sensitive = false;
+ burst_take_photo ();
+ GLib.Timeout.add (3500, burst_take_photo);
+ }
+ }
+
+ public void setup_ui ()
+ {
+ gtk_builder = new Gtk.Builder ();
+ clutter_builder = new Clutter.Script ();
+ fileutil = new FileUtil ();
+ flash = new Flash (this);
+
+ gtk_builder.add_from_file (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "cheese-actions.ui"));
+ gtk_builder.add_from_file (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "cheese-about.ui"));
+ gtk_builder.add_from_file (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "cheese-main-window.ui"));
+ gtk_builder.connect_signals (this);
+
+ clutter_builder.load_from_file (GLib.Path.build_filename (Config.PACKAGE_DATADIR, "cheese-viewport.json"));
+
+ main_vbox = (VBox) gtk_builder.get_object ("mainbox_normal");
+ thumbnails = (Widget) gtk_builder.get_object ("thumbnails");
+ viewport_widget = (GtkClutter.Embed)gtk_builder.get_object ("viewport");
+ viewport = (Clutter.Stage)viewport_widget.get_stage ();
+ thumbnails_right = (Frame) gtk_builder.get_object ("thumbnails_right");
+ thumbnails_bottom = (Frame) gtk_builder.get_object ("thumbnails_bottom");
+ menubar = (Gtk.MenuBar)gtk_builder.get_object ("main_menubar");
+ leave_fullscreen_button_container = (Gtk.HBox)gtk_builder.get_object ("leave_fullscreen_button_bin");
+ photo_toggle_button = (Gtk.ToggleButton)gtk_builder.get_object ("photo_toggle_button");
+ video_toggle_button = (Gtk.ToggleButton)gtk_builder.get_object ("video_toggle_button");
+ burst_toggle_button = (Gtk.ToggleButton)gtk_builder.get_object ("burst_toggle_button");
+ take_action_button = (Gtk.Button)gtk_builder.get_object ("take_action_button");
+ take_action_button_label = (Gtk.Label)gtk_builder.get_object ("take_action_button_internal_label");
+ take_action_button_image = (Gtk.Image)gtk_builder.get_object ("take_action_button_internal_image");
+ effects_toggle_button = (Gtk.ToggleButton)gtk_builder.get_object ("effects_toggle_button");
+ leave_fullscreen_button = (Gtk.Button)gtk_builder.get_object ("leave_fullscreen_button");
+ buttons_area = (Gtk.HBox)gtk_builder.get_object ("buttons_area");
+
+ take_photo_action = (Gtk.Action)gtk_builder.get_object ("take_photo");
+ take_video_action = (Gtk.Action)gtk_builder.get_object ("take_video");;
+ take_burst_action = (Gtk.Action)gtk_builder.get_object ("take_burst");;
+ photo_mode_action = (Gtk.Action)gtk_builder.get_object ("photo_mode");
+ video_mode_action = (Gtk.Action)gtk_builder.get_object ("video_mode");;
+ burst_mode_action = (Gtk.Action)gtk_builder.get_object ("burst_mode");;
+ effects_toggle_action = (Gtk.Action)gtk_builder.get_object ("effects_toggle");
+
+ /* Array contains all 'buttons', for easier manipulation
+ * IMPORTANT: IF ANOTHER BUTTON IS ADDED UNDER THE VIEWPORT, ADD IT TO THIS ARRAY */
+ buttons = {photo_toggle_button,
+ video_toggle_button,
+ burst_toggle_button,
+ take_action_button,
+ effects_toggle_button,
+ leave_fullscreen_button};
+
+ video_preview = (Clutter.Texture)clutter_builder.get_object ("video_preview");
+ viewport_layout = (Clutter.Box)clutter_builder.get_object ("viewport_layout");
+ viewport_layout_manager = (Clutter.BinLayout)clutter_builder.get_object ("viewport_layout_manager");
+ countdown_layer = (Clutter.Text)clutter_builder.get_object ("countdown_layer");
+
+ viewport_layout.set_layout_manager (viewport_layout_manager);
+
+ camera = new Camera (video_preview, "/dev/video0", 1024, 768);
+
+ viewport.add_actor (viewport_layout);
+
+ viewport.allocation_changed.connect (on_stage_resize);
+
+ thumb_view = new Cheese.ThumbView ();
+ thumb_nav = new Eog.ThumbNav (thumb_view, false);
+
+ viewport.show_all ();
+
+ camera.setup (conf.camera);
+ camera.play ();
+
+ set_wide_mode (true, true);
+ set_mode (MediaMode.PHOTO);
+
+ this.add (main_vbox);
+ }
}
diff --git a/valasrc/vapi/cheese-common.vapi b/valasrc/vapi/cheese-common.vapi
index c09bdd0..8191541 100644
--- a/valasrc/vapi/cheese-common.vapi
+++ b/valasrc/vapi/cheese-common.vapi
@@ -1,168 +1,179 @@
/* cheese-common.vapi generated by vapigen, do not modify. */
[CCode (cprefix = "Cheese", lower_case_cprefix = "cheese_")]
-namespace Cheese {
- [CCode (cheader_filename = "cheese-camera.h")]
- public class Camera : GLib.Object {
- [CCode (has_construct_function = false)]
- public Camera (Clutter.Texture video_texture, string camera_device_name, int x_resolution, int y_resolution);
- public bool get_balance_property_range (string property, double min, double max, double def);
- public unowned GLib.PtrArray get_camera_devices ();
- public unowned Cheese.VideoFormat get_current_video_format ();
- public int get_num_camera_devices ();
- public unowned Cheese.CameraDevice get_selected_device ();
- public unowned GLib.List get_video_formats ();
- public bool has_camera ();
- public void play ();
- public void set_balance_property (string property, double value);
- public void set_device_by_dev_file (string file);
- public void set_device_by_dev_udi (string udi);
- public void set_effect (Cheese.CameraEffect effect);
- public void set_video_format (Cheese.VideoFormat format);
- public void setup (string udi) throws GLib.Error;
- public void start_video_recording (string filename);
- public void stop ();
- public void stop_video_recording ();
- public bool switch_camera_device ();
- public bool take_photo (string filename);
- public bool take_photo_pixbuf ();
- [NoAccessorMethod]
- public string device_name { owned get; set; }
- [NoAccessorMethod]
- public Cheese.VideoFormat format { owned get; set; }
- [NoAccessorMethod]
- public void* video_texture { get; set; }
- public virtual signal void photo_saved ();
- public virtual signal void photo_taken (Gdk.Pixbuf pixbuf);
- public virtual signal void video_saved ();
- }
- [CCode (cheader_filename = "cheese-camera-device.h")]
- public class CameraDevice : GLib.Object, GLib.Initable {
- [CCode (has_construct_function = false)]
- public CameraDevice (string device_id, string device_file, string product_name, int api_version) throws GLib.Error;
- public unowned Cheese.VideoFormat get_best_format ();
- public unowned Gst.Caps get_caps_for_format (Cheese.VideoFormat format);
- public unowned string get_device_file ();
- public unowned GLib.List get_format_list ();
- public unowned string get_id ();
- public unowned string get_name ();
- public unowned string get_src ();
- [NoAccessorMethod]
- public int api { get; construct; }
- public string device_file { get; construct; }
- [NoAccessorMethod]
- public string device_id { owned get; construct; }
- public string name { get; construct; }
- }
+namespace Cheese
+{
+ [CCode (cheader_filename = "cheese-camera.h")]
+ public class Camera : GLib.Object
+ {
+ [CCode (has_construct_function = false)]
+ public Camera (Clutter.Texture video_texture, string camera_device_name, int x_resolution, int y_resolution);
+ public bool get_balance_property_range (string property, double min, double max, double def);
+ public unowned GLib.PtrArray get_camera_devices ();
+ public unowned Cheese.VideoFormat get_current_video_format ();
+ public int get_num_camera_devices ();
+ public unowned Cheese.CameraDevice get_selected_device ();
+ public unowned GLib.List get_video_formats ();
+ public bool has_camera ();
+ public void play ();
+ public void set_balance_property (string property, double value);
+ public void set_device_by_dev_file (string file);
+ public void set_device_by_dev_udi (string udi);
+ public void set_effect (Cheese.CameraEffect effect);
+ public void set_video_format (Cheese.VideoFormat format);
+ public void setup (string udi) throws GLib.Error;
+ public void start_video_recording (string filename);
+ public void stop ();
+ public void stop_video_recording ();
+ public bool switch_camera_device ();
+ public bool take_photo (string filename);
+ public bool take_photo_pixbuf ();
+ [NoAccessorMethod]
+ public string device_name {owned get; set;}
+ [NoAccessorMethod]
+ public Cheese.VideoFormat format {owned get; set;}
+ [NoAccessorMethod]
+ public void *video_texture {get; set;}
+ public virtual signal void photo_saved ();
+ public virtual signal void photo_taken (Gdk.Pixbuf pixbuf);
+ public virtual signal void video_saved ();
+ }
+ [CCode (cheader_filename = "cheese-camera-device.h")]
+ public class CameraDevice : GLib.Object, GLib.Initable
+ {
+ [CCode (has_construct_function = false)]
+ public CameraDevice (string device_id, string device_file, string product_name, int api_version) throws GLib.Error;
+ public unowned Cheese.VideoFormat get_best_format ();
+ public unowned Gst.Caps get_caps_for_format (Cheese.VideoFormat format);
+ public unowned string get_device_file ();
+ public unowned GLib.List get_format_list ();
+ public unowned string get_id ();
+ public unowned string get_name ();
+ public unowned string get_src ();
+ [NoAccessorMethod]
+ public int api {get; construct;}
+ public string device_file {get; construct;}
+ [NoAccessorMethod]
+ public string device_id {owned get; construct;}
+ public string name {get; construct;}
+ }
- [CCode (cheader_filename = "cheese-camera-device-monitor.h")]
- public class CameraDeviceMonitor : GLib.Object {
- [CCode (has_construct_function = false)]
- public CameraDeviceMonitor ();
- public void coldplug ();
- public virtual signal void added (string id, string device_file, string product_name, int api_version);
- public virtual signal void removed (string id);
- }
+ [CCode (cheader_filename = "cheese-camera-device-monitor.h")]
+ public class CameraDeviceMonitor : GLib.Object
+ {
+ [CCode (has_construct_function = false)]
+ public CameraDeviceMonitor ();
+ public void coldplug ();
+ public virtual signal void added (string id, string device_file, string product_name, int api_version);
+ public virtual signal void removed (string id);
+ }
-
- [CCode (cheader_filename = "cheese-fileutil.h")]
- public class FileUtil : GLib.Object{
- [CCode (cname = "cheese_fileutil_new", has_construct_function = false)]
- public FileUtil ();
- [CCode (cname = "cheese_fileutil_get_log_path")]
- public unowned string get_log_path ();
- [CCode (cname = "cheese_fileutil_get_new_media_filename")]
- public unowned string get_new_media_filename (Cheese.MediaMode mode);
- [CCode (cname = "cheese_fileutil_get_path_before_224")]
- public unowned string get_path_before_224 ();
- [CCode (cname = "cheese_fileutil_get_photo_path")]
- public unowned string get_photo_path ();
- [CCode (cname = "cheese_fileutil_get_video_path")]
- public unowned string get_video_path ();
- [CCode (cname = "cheese_fileutil_reset_burst")]
- public void reset_burst ();
- }
-
- [CCode (cheader_filename = "cheese-flash.h")]
- public class Flash : GLib.Object {
- [CCode (has_construct_function = false)]
- public Flash (Gtk.Widget parent);
- public void fire ();
- }
-
- [CCode (cheader_filename = "cheese-gconf.h")]
- public class GConf : GLib.Object {
- [CCode (has_construct_function = false)]
- public GConf ();
- [NoAccessorMethod, CCode (cname="gconf_prop_brightness")]
- public double brightness { get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_burst_delay")]
- public int burst_delay { get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_burst_repeat")]
- public int burst_repeat { get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_camera")]
- public string camera { owned get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_contrast")]
- public double contrast { get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_countdown")]
- public bool countdown { get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_enable_delete")]
- public bool enable_delete { get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_hue")]
- public double hue { get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_photo_path")]
- public string photo_path { owned get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_saturation")]
- public double saturation { get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_selected_effects")]
- public string selected_effects { owned get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_video_path")]
- public string video_path { owned get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_wide_mode")]
- public bool wide_mode { get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_x_resolution")]
- public int x_resolution { get; set; }
- [NoAccessorMethod, CCode (cname="gconf_prop_y_resolution")]
- public int y_resolution { get; set; }
- }
-
- [Compact]
- [CCode (type_id = "CHEESE_TYPE_VIDEO_FORMAT", cheader_filename = "cheese-camera-device.h")]
- public class VideoFormat {
- public int height;
- public int width;
- }
- [CCode (cprefix = "CHEESE_CAMERA_EFFECT_", has_type_id = false, cheader_filename = "cheese-camera.h")]
- public enum CameraEffect {
- NO_EFFECT,
- MAUVE,
- NOIR_BLANC,
- SATURATION,
- HULK,
- VERTICAL_FLIP,
- HORIZONTAL_FLIP,
- SHAGADELIC,
- VERTIGO,
- EDGE,
- DICE,
- WARP
- }
- [CCode (cprefix = "CHEESE_MEDIA_MODE_", has_type_id = false, cheader_filename = "cheese-fileutil.h")]
- public enum MediaMode {
- PHOTO,
- VIDEO,
- BURST
- }
- [CCode (cprefix = "CHEESE_WIDGET_STATE_", cheader_filename = "cheese-fileutil.h")]
- public enum WidgetState {
- NONE,
- READY,
- ERROR
- }
- [CCode (cheader_filename = "cheese-countdown.h")]
- public delegate void cheese_countdown_cb_t ();
- [CCode (cheader_filename = "cheese-fileutil.h")]
- public const string PHOTO_NAME_SUFFIX;
- [CCode (cheader_filename = "cheese-fileutil.h")]
- public const string VIDEO_NAME_SUFFIX;
+
+ [CCode (cheader_filename = "cheese-fileutil.h")]
+ public class FileUtil : GLib.Object
+ {
+ [CCode (cname = "cheese_fileutil_new", has_construct_function = false)]
+ public FileUtil ();
+ [CCode (cname = "cheese_fileutil_get_log_path")]
+ public unowned string get_log_path ();
+ [CCode (cname = "cheese_fileutil_get_new_media_filename")]
+ public unowned string get_new_media_filename (Cheese.MediaMode mode);
+ [CCode (cname = "cheese_fileutil_get_path_before_224")]
+ public unowned string get_path_before_224 ();
+ [CCode (cname = "cheese_fileutil_get_photo_path")]
+ public unowned string get_photo_path ();
+ [CCode (cname = "cheese_fileutil_get_video_path")]
+ public unowned string get_video_path ();
+ [CCode (cname = "cheese_fileutil_reset_burst")]
+ public void reset_burst ();
+ }
+
+ [CCode (cheader_filename = "cheese-flash.h")]
+ public class Flash : GLib.Object
+ {
+ [CCode (has_construct_function = false)]
+ public Flash (Gtk.Widget parent);
+ public void fire ();
+ }
+
+ [CCode (cheader_filename = "cheese-gconf.h")]
+ public class GConf : GLib.Object
+ {
+ [CCode (has_construct_function = false)]
+ public GConf ();
+ [NoAccessorMethod, CCode (cname = "gconf_prop_brightness")]
+ public double brightness {get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_burst_delay")]
+ public int burst_delay {get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_burst_repeat")]
+ public int burst_repeat {get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_camera")]
+ public string camera {owned get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_contrast")]
+ public double contrast {get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_countdown")]
+ public bool countdown {get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_enable_delete")]
+ public bool enable_delete {get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_hue")]
+ public double hue {get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_photo_path")]
+ public string photo_path {owned get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_saturation")]
+ public double saturation {get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_selected_effects")]
+ public string selected_effects {owned get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_video_path")]
+ public string video_path {owned get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_wide_mode")]
+ public bool wide_mode {get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_x_resolution")]
+ public int x_resolution {get; set;}
+ [NoAccessorMethod, CCode (cname = "gconf_prop_y_resolution")]
+ public int y_resolution {get; set;}
+ }
+
+ [Compact]
+ [CCode (type_id = "CHEESE_TYPE_VIDEO_FORMAT", cheader_filename = "cheese-camera-device.h")]
+ public class VideoFormat
+ {
+ public int height;
+ public int width;
+ }
+ [CCode (cprefix = "CHEESE_CAMERA_EFFECT_", has_type_id = false, cheader_filename = "cheese-camera.h")]
+ public enum CameraEffect
+ {
+ NO_EFFECT,
+ MAUVE,
+ NOIR_BLANC,
+ SATURATION,
+ HULK,
+ VERTICAL_FLIP,
+ HORIZONTAL_FLIP,
+ SHAGADELIC,
+ VERTIGO,
+ EDGE,
+ DICE,
+ WARP
+ }
+ [CCode (cprefix = "CHEESE_MEDIA_MODE_", has_type_id = false, cheader_filename = "cheese-fileutil.h")]
+ public enum MediaMode
+ {
+ PHOTO,
+ VIDEO,
+ BURST
+ }
+ [CCode (cprefix = "CHEESE_WIDGET_STATE_", cheader_filename = "cheese-fileutil.h")]
+ public enum WidgetState
+ {
+ NONE,
+ READY,
+ ERROR
+ }
+ [CCode (cheader_filename = "cheese-countdown.h")]
+ public delegate void cheese_countdown_cb_t ();
+ [CCode (cheader_filename = "cheese-fileutil.h")]
+ public const string PHOTO_NAME_SUFFIX;
+ [CCode (cheader_filename = "cheese-fileutil.h")]
+ public const string VIDEO_NAME_SUFFIX;
}
diff --git a/valasrc/vapi/cheese-thumbview.vapi b/valasrc/vapi/cheese-thumbview.vapi
index fdc2123..97ca87d 100644
--- a/valasrc/vapi/cheese-thumbview.vapi
+++ b/valasrc/vapi/cheese-thumbview.vapi
@@ -1,10 +1,12 @@
using GLib;
-namespace Cheese{
- [CCode (cheader_filename="thumbview/cheese-thumb-view.h")]
- public class ThumbView : Gtk.IconView {
- public ThumbView ();
- string get_selected_image();
- int get_n_selected();
- void remove_item(GLib.File file);
- }
-}
\ No newline at end of file
+namespace Cheese
+{
+ [CCode (cheader_filename = "thumbview/cheese-thumb-view.h")]
+ public class ThumbView : Gtk.IconView
+ {
+ public ThumbView ();
+ string get_selected_image ();
+ int get_n_selected ();
+ void remove_item (GLib.File file);
+ }
+}
diff --git a/valasrc/vapi/config.vapi b/valasrc/vapi/config.vapi
index 3e79ba6..9400f97 100644
--- a/valasrc/vapi/config.vapi
+++ b/valasrc/vapi/config.vapi
@@ -1,9 +1,10 @@
[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "cheese-config.h")]
-namespace Config {
- public const string GETTEXT_PACKAGE;
- public const string PACKAGE_DATADIR;
- public const string PACKAGE_LOCALEDIR;
- public const string PACKAGE_NAME;
- public const string PACKAGE_VERSION;
- public const string VERSION;
+namespace Config
+{
+ public const string GETTEXT_PACKAGE;
+ public const string PACKAGE_DATADIR;
+ public const string PACKAGE_LOCALEDIR;
+ public const string PACKAGE_NAME;
+ public const string PACKAGE_VERSION;
+ public const string VERSION;
}
diff --git a/valasrc/vapi/eogthumbnav.vapi b/valasrc/vapi/eogthumbnav.vapi
index fb3ed9b..2f79d1e 100644
--- a/valasrc/vapi/eogthumbnav.vapi
+++ b/valasrc/vapi/eogthumbnav.vapi
@@ -1,13 +1,15 @@
using Gtk;
-namespace Eog{
- [CCode (cheader_filename="thumbview/eog-thumb-nav.h")]
- public class ThumbNav : Gtk.HBox {
- public ThumbNav (Gtk.Widget thumbview, bool show_buttons);
- public bool get_show_buttons();
- public void set_show_buttons(bool show_buttons);
- public bool is_vertical();
- public void set_vertical(bool vertical);
- public void set_policy(Gtk.PolicyType hscrollbar_policy,
- Gtk.PolicyType vscrollbar_policy);
- }
-}
\ No newline at end of file
+namespace Eog
+{
+ [CCode (cheader_filename = "thumbview/eog-thumb-nav.h")]
+ public class ThumbNav : Gtk.HBox
+ {
+ public ThumbNav (Gtk.Widget thumbview, bool show_buttons);
+ public bool get_show_buttons ();
+ public void set_show_buttons (bool show_buttons);
+ public bool is_vertical ();
+ public void set_vertical (bool vertical);
+ public void set_policy (Gtk.PolicyType hscrollbar_policy,
+ Gtk.PolicyType vscrollbar_policy);
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]