[cheese/three-point-oh: 12/12] Simple clutter stage embedded, basic layout in place
- From: Yuvaraj Pandian <yuvipanda src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese/three-point-oh: 12/12] Simple clutter stage embedded, basic layout in place
- Date: Thu, 27 May 2010 10:20:36 +0000 (UTC)
commit 90510b8d1580dd7f354cec6d0dfdbdff0a26be27
Author: Yuvaraj Pandian T <yuvipanda gmail com>
Date: Thu May 27 15:27:23 2010 +0530
Simple clutter stage embedded, basic layout in place
configure.ac | 6 +++++-
data/cheese.ui | 31 +++++++++++++++++++++++++++++++
valasrc/Makefile.am | 4 +++-
valasrc/cheese-main.vala | 10 +++++++---
valasrc/cheese-window.vala | 25 +++++++++++++++++++++++--
5 files changed, 69 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 19c19a5..1161741 100644
--- a/configure.ac
+++ b/configure.ac
@@ -88,6 +88,8 @@ DBUS_REQUIRED=1.0
DBUS_GLIB_REQUIRED=0.7
PANGOCAIRO_REQUIRED=1.18.0
LIBRSVG_REQUIRED=2.18.0
+CLUTTER_REQUIRED=1.0
+CLUTTERGTK_REQUIRED=0.10
#*******************************************************************************
# Check for udev
@@ -142,7 +144,9 @@ PKG_CHECK_MODULES(CHEESE, \
dbus-1 >= $DBUS_REQUIRED \
dbus-glib-1 >= $DBUS_GLIB_REQUIRED \
pangocairo >= $PANGOCAIRO_REQUIRED \
- librsvg-2.0 >= $LIBRSVG_REQUIRED
+ librsvg-2.0 >= $LIBRSVG_REQUIRED \
+ clutter-1.0 >= $CLUTTER_REQUIRED \
+ clutter-gtk-0.10 >= $CLUTTERGTK_REQUIRED \
libcanberra-gtk $UDEV_PKG)
AC_SUBST(CHEESE_CFLAGS)
diff --git a/data/cheese.ui b/data/cheese.ui
index d8ad3e8..1142f72 100644
--- a/data/cheese.ui
+++ b/data/cheese.ui
@@ -276,9 +276,40 @@
</object>
<object class="GtkVBox" id="mainbox_normal">
+ <property name="homogeneous">False</property>
<child>
<object class="GtkMenuBar" id="main_menubar" constructor="menu_ui_man">
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="content_area">
+ <child>
+ <object class="GtkVBox" id="view_area">
+ <child>
+ <object class="GtkClutterEmbed" id="viewport">
+ <property name="height_request">450</property>
+ <property name="width_request">600</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkFrame" id="thumbnails">
+ <property name="width_request">140</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ </object>
</child>
</object>
</interface>
\ No newline at end of file
diff --git a/valasrc/Makefile.am b/valasrc/Makefile.am
index 53e08ae..572103d 100644
--- a/valasrc/Makefile.am
+++ b/valasrc/Makefile.am
@@ -3,7 +3,9 @@ VALAFLAGS = \
--vapidir vapi \
--pkg config \
--pkg gtk+-2.0 \
- --pkg gmodule-2.0
+ --pkg gmodule-2.0 \
+ --pkg clutter-1.0 \
+ --pkg clutter-gtk-0.10
AM_CPPFLAGS = \
-DBINDIR=\"$(bindir)\" \
diff --git a/valasrc/cheese-main.vala b/valasrc/cheese-main.vala
index 495f064..11e22b7 100644
--- a/valasrc/cheese-main.vala
+++ b/valasrc/cheese-main.vala
@@ -1,4 +1,6 @@
-using GLib, Gtk;
+using GLib;
+using Gtk;
+using Clutter;
public class Cheese.Main {
static bool verbose;
@@ -27,12 +29,14 @@ public class Cheese.Main {
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.parse (ref args);
} catch (OptionError e) {
stdout.printf ("%s\n", e.message);
@@ -43,9 +47,9 @@ public class Cheese.Main {
Environment.set_application_name (_("Cheese"));
Window.set_default_icon_name ("cheese");
- string log_file_dir = Path.build_filename (Environment.get_home_dir(), ".config", "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 (Path.build_filename (log_file_dir, "cheese.log"), "w");
+ log_file = FileStream.open (GLib.Path.build_filename (log_file_dir, "cheese.log"), "w");
set_print_handler (print_handler);
Cheese.MainWindow main_window = new Cheese.MainWindow();
diff --git a/valasrc/cheese-window.vala b/valasrc/cheese-window.vala
index fc5d19d..ecb7f42 100644
--- a/valasrc/cheese-window.vala
+++ b/valasrc/cheese-window.vala
@@ -1,8 +1,17 @@
+
using Gtk;
using Gdk;
+using GtkClutter;
+using Clutter;
+
+const int DEFAULT_WINDOW_WIDTH = 600;
+const int DEFAULT_WINDOW_HEIGHT = 450;
public class Cheese.MainWindow : Gtk.Window {
+ private Widget thumbnails;
+ private GtkClutter.Embed viewport_widget;
+ private Clutter.Stage viewport;
[CCode (instance_pos = -1)]
internal void on_quit (Action action ) {
destroy();
@@ -20,11 +29,23 @@ public class Cheese.MainWindow : Gtk.Window {
public void setup_ui () {
Builder builder = new Builder();
VBox main_vbox;
- builder.add_from_file (Path.build_filename ("../data/", "cheese.ui"));
+ builder.add_from_file (GLib.Path.build_filename ("../data/", "cheese.ui"));
builder.connect_signals(this);
main_vbox = (VBox) builder.get_object ("mainbox_normal");
-
+ thumbnails = (Widget) builder.get_object("thumbnails");
+ viewport_widget = (GtkClutter.Embed) builder.get_object("viewport");
+ viewport = (Clutter.Stage) viewport_widget.get_stage();
+
+ Clutter.Rectangle r = new Clutter.Rectangle();
+ r.width = 200;
+ r.height = 600;
+ r.x = 0;
+ r.y = 0;
+ r.color = Clutter.Color.from_string("Red");
+ viewport.add_actor(r);
+
+ viewport.show_all();
this.add(main_vbox);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]