cheese r740 - in branches/cheese-vala: . src
- From: jhaitsma svn gnome org
- To: svn-commits-list gnome org
- Subject: cheese r740 - in branches/cheese-vala: . src
- Date: Sun, 1 Jun 2008 18:30:48 +0000 (UTC)
Author: jhaitsma
Date: Sun Jun 1 18:30:47 2008
New Revision: 740
URL: http://svn.gnome.org/viewvc/cheese?rev=740&view=rev
Log:
Fix callbacks
Modified:
branches/cheese-vala/ (props changed)
branches/cheese-vala/src/cheese-thumb-view.vala
branches/cheese-vala/src/cheese-webcam.vala
Modified: branches/cheese-vala/src/cheese-thumb-view.vala
==============================================================================
--- branches/cheese-vala/src/cheese-thumb-view.vala (original)
+++ branches/cheese-vala/src/cheese-thumb-view.vala Sun Jun 1 18:30:47 2008
@@ -179,7 +179,7 @@
}
- void on_file_changed (FileMonitor sender, File file, File other_file, FileMonitorEvent event_type) {
+ void on_file_changed (FileMonitor sender, File file, File? other_file, FileMonitorEvent event_type) {
switch (event_type) {
case FileMonitorEvent.DELETED:
remove_thumb (file);
@@ -192,7 +192,7 @@
}
}
- void on_drag_data_get (DragContext drag_context, SelectionData data, uint info, uint time) {
+ void on_drag_data_get (ThumbView view, DragContext drag_context, SelectionData data, uint info, uint time) {
}
Modified: branches/cheese-vala/src/cheese-webcam.vala
==============================================================================
--- branches/cheese-vala/src/cheese-webcam.vala (original)
+++ branches/cheese-vala/src/cheese-webcam.vala Sun Jun 1 18:30:47 2008
@@ -255,8 +255,9 @@
overlay.set_xwindow_id (x11_drawable_get_xid (video_window.window));
}
- void on_expose (Widget sender, Gdk.Event event) {
+ bool on_expose (Widget sender, Gdk.Event event) {
set_x_overlay ();
+ return false;
}
void on_photo_data (Element element, Buffer buffer, Pad pad) {
@@ -327,32 +328,32 @@
void get_supported_framerates (VideoFormat format, Structure structure) {
- Gst.Value* frame_rates;
- frame_rates = structure.get_value ("framerate");
+
+ var frame_rates = structure.get_value ("framerate");
- if ((*frame_rates).holds (fraction_get_type ())) {
+ if (frame_rates.holds (fraction_get_type ())) {
var frame_rate = new FrameRate ();
- frame_rate.numerator = (*frame_rates).get_fraction_numerator ();
- frame_rate.denominator = (*frame_rates).get_fraction_denominator ();
+ frame_rate.numerator = frame_rates.get_fraction_numerator ();
+ frame_rate.denominator = frame_rates.get_fraction_denominator ();
format.frame_rate.add (frame_rate);
- } else if ((*frame_rates).holds (Gst.Value.list_get_type ())) {
- for (int i = 0; i < (*frame_rates).list_get_size (); i++) {
- Gst.Value *f;
- f = (*frame_rates).list_get_value (i);
+ } else if (frame_rates.holds (Gst.Value.list_get_type ())) {
+ for (int i = 0; i < frame_rates.list_get_size (); i++) {
+
+ var f = frame_rates.list_get_value (i);
var frame_rate = new FrameRate ();
- frame_rate.numerator = (*f).get_fraction_numerator ();
- frame_rate.denominator = (*f).get_fraction_denominator ();
+ frame_rate.numerator = f.get_fraction_numerator ();
+ frame_rate.denominator = f.get_fraction_denominator ();
format.frame_rate.add (frame_rate);
}
- } else if ((*frame_rates).holds (fraction_range_get_type ())) {
- Gst.Value* fraction_range_min = (*frame_rates).get_fraction_range_min ();
- int numerator_min = (*fraction_range_min).get_fraction_numerator ();
- int denominator_min = (*fraction_range_min).get_fraction_denominator ();
-
- Gst.Value* fraction_range_max = (*frame_rates).get_fraction_range_max ();
- int numerator_max = (*fraction_range_max).get_fraction_numerator ();
- int denominator_max = (*fraction_range_max).get_fraction_denominator ();
+ } else if (frame_rates.holds (fraction_range_get_type ())) {
+ var fraction_range_min = frame_rates.get_fraction_range_min ();
+ int numerator_min = fraction_range_min.get_fraction_numerator ();
+ int denominator_min = fraction_range_min.get_fraction_denominator ();
+
+ var fraction_range_max = frame_rates.get_fraction_range_max ();
+ int numerator_max = fraction_range_max.get_fraction_numerator ();
+ int denominator_max = fraction_range_max.get_fraction_denominator ();
print ("FractionRange: %d/%d - %d/%d\n", numerator_min, denominator_min, numerator_max, denominator_max);
for (int i = numerator_min; i <= numerator_max; i++) {
@@ -364,7 +365,7 @@
}
}
} else {
- critical ("GValue type %s, cannot be handled for framerates", (*frame_rates).type_name ());
+ critical ("GValue type %s, cannot be handled for framerates", frame_rates.type_name ());
}
}
@@ -383,10 +384,10 @@
continue;
}
- Gst.Value* width = structure.get_value ("width");
- Gst.Value* height = structure.get_value ("height");
+ var width = structure.get_value ("width");
+ var height = structure.get_value ("height");
- if ((*width).holds (typeof (int))) {
+ if (width.holds (typeof (int))) {
var format = new VideoFormat ();
format.mime_type = structure.get_name ();
@@ -395,14 +396,12 @@
get_supported_framerates (format, structure);
device.video_format.add (format);
- } else if ((*width).holds (int_range_get_type ())) {
- // FIXME: vala bug. int_range_get_type should have class
-
+ } else if (width.holds (int_range_get_type ())) {
print ("width hold int_range type\n");
- int min_width = (*width).get_int_range_min ();
- int max_width = (*width).get_int_range_max ();
- int min_height = (*height).get_int_range_min ();
- int max_height = (*height).get_int_range_max ();
+ int min_width = width.get_int_range_min ();
+ int max_width = width.get_int_range_max ();
+ int min_height = height.get_int_range_min ();
+ int max_height = height.get_int_range_max ();
int cur_width = min_width;
int cur_height = min_height;
@@ -435,7 +434,7 @@
cur_height /= 2;
}
} else {
- critical ("GValue type %s, cannot be handled for resolution width", ((*width).type_name ()));
+ critical ("GValue type %s, cannot be handled for resolution width", (width.type_name ()));
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]