Active Topics

 



Notices


Reply
Thread Tools
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#221
Yes, I know this one.
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 

The Following User Says Thank You to Bundyo For This Useful Post:
TrueJournals's Avatar
Posts: 480 | Thanked: 378 times | Joined on Apr 2008 @ Chicago-ish
#222
Well, I'm trying to get an environment set up to be able to compile tear. To play around with the source code, and see what vala can do. I've got it almost all working, but I'm running into some trouble. First, I run:
Code:
[sbox-DIABLO_ARMEL: ~/tear/tear] > ./waf configure
Checking for program gcc                 : ok /scratchbox/compilers/bin/gcc 
Checking for compiler version            : ok 3.4.4 
Checking for program cpp                 : ok /scratchbox/compilers/bin/cpp 
Checking for program ar                  : ok /scratchbox/compilers/bin/ar 
Checking for program ranlib              : ok /scratchbox/compilers/bin/ranlib 
Checking for compiler could create programs : ok  
Checking for compiler could create shared libs : ok  
Checking for compiler could create static libs : ok  
Checking for flags -O2                         : ok  
Checking for flags -g -DDEBUG                  : ok  
Checking for flags -g3 -O0 -DDEBUG             : ok  
Checking for flags -Wall                       : ok  
Checking for gcc                               : ok  
Checking for program valac                     : ok /usr/bin/valac 
Checking for package gthread-2.0               : ok  
Checking for program version valac >= 0.1.6    : ok 0.5.7 
Checking for program msgfmt                    : ok /scratchbox/tools/bin/msgfmt 
Checking for program intltool-merge            : ok /usr/bin/intltool-merge 
Checking for header locale.h                   : ok  
Checking for package glib-2.0 >= 2.10.0        : ok  
Checking for package gconf-2.0 >= 2.10.0       : ok  
Checking for package gobject-2.0 >= 2.10.0     : ok  
Checking for package gtk+-2.0 >= 2.10.0        : ok  
Checking for package hildon-1 >= 1.0           : ok  
Checking for package hildon-fm-2 >= 1.9        : ok  
Checking for package conic >= 0.16             : ok  
Checking for package libpcre >= 6.5            : ok  
Checking for package libosso >= 2.0            : ok  
Checking for package sqlite3 >= 3.0            : ok  
Checking for package webkit-1.0 >= 1.0         : ok  
Configuration finished successfully; project is now ready to build.
Huzzah! No troubles there. Now to build it...
Code:
[sbox-DIABLO_ARMEL: ~/tear/tear] > ./waf build
[ 1/23] valac: src/tear.vala src/uim.vala src/about.vala src/settings.vala src/dbqueue.vala src/connmanager.vala src/imagemenuitem.vala src/ovbox.vala src/drawer.vala src/quickbar.vala src/tearwebview.vala src/downloadmanager.vala src/downloaditem.vala src/checkbutton.vala src/option.vala src/blocker.vala src/blockerrule.vala src/dbusservice.vala src/dbusserver.vala src/optionsmanager.vala src/menu.vala
about.vala:31.21-31.96: warning: unhandled error `GLib.Error'
optionsmanager.vala:200.8-200.29: warning: result variable type incompatible with return type
optionsmanager.vala:320.10-320.15: warning: result variable type incompatible with return type
option.vala:24.14-24.31: warning: deprecated syntax, don't use `new' to initialize structs
dbqueue.vala:94.10-94.15: warning: result variable type incompatible with return type
dbqueue.vala:44.7-44.206: warning: result variable type incompatible with return type
quickbar.vala:9.2-9.23: warning: Tear.Quickbar.model hides inherited field `Gtk.ComboBox.model'. Use the `new' keyword if hiding was intentional
quickbar.vala:81.24-81.29: warning: result variable type incompatible with return type
quickbar.vala:110.28-110.33: warning: result variable type incompatible with return type
quickbar.vala:123.24-123.29: warning: result variable type incompatible with return type
optionsmanager.vala:277.4-277.15: warning: `null' incompatible with return type `string`
optionsmanager.vala:282.13-282.24: warning: `null' incompatible with return type `string`
ovbox.vala:120.31-120.50: warning: deprecated syntax, don't use `new' to initialize structs
ovbox.vala:204.26-204.45: warning: deprecated syntax, don't use `new' to initialize structs
ovbox.vala:205.25-205.44: warning: deprecated syntax, don't use `new' to initialize structs
quickbar.vala:142.24-142.29: warning: result variable type incompatible with return type
quickbar.vala:191.10-191.15: warning: result variable type incompatible with return type
optionsmanager.vala:239.18-239.30: warning: deprecated syntax, don't use `new' to initialize structs
optionsmanager.vala:247.8-247.13: warning: result variable type incompatible with return type
optionsmanager.vala:267.18-267.30: warning: deprecated syntax, don't use `new' to initialize structs
tear.vala:1123.9-1123.35: warning: result variable type incompatible with return type
tear.vala:1348.29-1348.34: warning: result variable type incompatible with return type
downloaditem.vala:15.14-15.31: warning: deprecated syntax, don't use `new' to initialize structs
downloadmanager.vala:17.3-17.78: warning: unhandled error `GLib.Error'
tear.vala:1544.25-1544.30: warning: result variable type incompatible with return type
checkbutton.vala:8.2-8.20: warning: Tear.CheckButton.label hides inherited property `Gtk.Button.label'. Use the `new' keyword if hiding was intentional
checkbutton.vala:12.2-12.19: warning: Tear.CheckButton.active hides inherited property `Gtk.ToggleButton.active'. Use the `new' keyword if hiding was intentional
tear.vala:607.22-607.27: warning: result variable type incompatible with return type
tear.vala:812.4-812.79: warning: unhandled error `GLib.Error'
optionsmanager.vala:226.8-226.29: warning: result variable type incompatible with return type
optionsmanager.vala:372.10-372.15: warning: result variable type incompatible with return type
optionsmanager.vala:20.24-20.29: warning: result variable type incompatible with return type
optionsmanager.vala:25.3-25.78: warning: unhandled error `GLib.Error'
uim.vala:118.2-118.25: warning: Tear.UIManager.get_action hides inherited method `Gtk.UIManager.get_action'. Use the `new' keyword if hiding was intentional
uim.vala:85.3-85.32: warning: unhandled error `GLib.Error'
tear.vala:753.8-753.93: warning: local variable `act' declared but never used
tearwebview.vala:48.5-48.10: warning: unreachable code detected
[ 2/23] cc: _build_/default/src/tear.c -> _build_/default/src/tear_1.o
default/src/tear.c: In function `tear_browser_window_check_if_dirty':
default/src/tear.c:2259: warning: too many arguments for format
default/src/tear.c: In function `_on_action_activated_gtk_ui_manager_post_activate':
default/src/tear.c:2329: warning: passing arg 1 of `on_action_activated' from incompatible pointer type
default/src/tear.c: In function `tear_browser_window_get_property':
default/src/tear.c:2545: warning: unused variable `boxed'
[ 3/23] cc: _build_/default/src/uim.c -> _build_/default/src/uim_1.o
[ 4/23] cc: _build_/default/src/about.c -> _build_/default/src/about_1.o
default/src/about.c: In function `tear_about_constructor':
default/src/about.c:85: warning: passing arg 2 of `gtk_about_dialog_set_authors' from incompatible pointer type
[ 5/23] cc: _build_/default/src/settings.c -> _build_/default/src/settings_1.o
[ 6/23] cc: _build_/default/src/dbqueue.c -> _build_/default/src/dbqueue_1.o
[ 7/23] cc: _build_/default/src/connmanager.c -> _build_/default/src/connmanager_1.o
[ 8/23] cc: _build_/default/src/imagemenuitem.c -> _build_/default/src/imagemenuitem_1.o
default/src/imagemenuitem.c: In function `tear_menu_item_get_property':
default/src/imagemenuitem.c:119: warning: unused variable `boxed'
[ 9/23] cc: _build_/default/src/ovbox.c -> _build_/default/src/ovbox_1.o
default/src/ovbox.c: In function `tear_ov_box_get_over_geometry':
default/src/ovbox.c:121: warning: implicit declaration of function `round'
default/src/ovbox.c: In function `tear_ov_box_class_init':
default/src/ovbox.c:532: warning: assignment from incompatible pointer type
[10/23] cc: _build_/default/src/drawer.c -> _build_/default/src/drawer_1.o
[11/23] cc: _build_/default/src/quickbar.c -> _build_/default/src/quickbar_1.o
[12/23] cc: _build_/default/src/tearwebview.c -> _build_/default/src/tearwebview_1.o
[13/23] cc: _build_/default/src/downloadmanager.c -> _build_/default/src/downloadmanager_1.o
In file included from default/src/downloadmanager.c:3:
/usr/include/hildon-mime.h:28:35: libgnomevfs/gnome-vfs.h: No such file or directory
/usr/include/hildon-mime.h:29:50: libgnomevfs/gnome-vfs-mime-handlers.h: No such file or directory
In file included from default/src/downloadmanager.c:3:
/usr/include/hildon-mime.h:75: error: syntax error before "GnomeVFSFileInfo"
default/src/downloadmanager.c: In function `tear_download_manager_progress_update_cb':
default/src/downloadmanager.c:247: warning: implicit declaration of function `lround'
Build failed
 -> task failed (err #129): [bld:///home/bobby/tear/tear/src/downloadmanager_1.o]
A lot of warnings, and something stopping the build from completing. I've poked around a bit, but haven't found anything to make it build. I'm using the latest code from garage's SVN. Am I using old code? Is SVN unstable currently? Or is there something I'm missing?
__________________
Disclaimer: If a program I wrote doesn't work/breaks your tablet... It's not my fault
mcedit | Utility Calculators (WIP) | PyRDesktop
My Blog | Twitter
 

The Following User Says Thank You to TrueJournals For This Useful Post:
TrueJournals's Avatar
Posts: 480 | Thanked: 378 times | Joined on Apr 2008 @ Chicago-ish
#223
Ah ha! Got it working! Had to copy the folder /usr/include/gnome-vfs-2.0/libgnomevfs to /usr/include (So that /usr/include/libgnomevfs exists). Note that this must be done within scratchbox. Is this a bug in the package that contains hildon-mime.h ?
__________________
Disclaimer: If a program I wrote doesn't work/breaks your tablet... It's not my fault
mcedit | Utility Calculators (WIP) | PyRDesktop
My Blog | Twitter
 

The Following 2 Users Say Thank You to TrueJournals For This Useful Post:
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#224
Originally Posted by TrueJournals View Post
Ah ha! Got it working!
Let's say I just installed the latest Ubuntu and the first thing I wanted to do was compile Tear. Do you think you could give me line-by-line instructions how to do that? If so, would you?
__________________
N9: Go white or go home
 
TrueJournals's Avatar
Posts: 480 | Thanked: 378 times | Joined on Apr 2008 @ Chicago-ish
#225
First off, I've fixed a bug I have a version of Tear running on my tablet that will show the toolbar after a sufficient amount of time, instead of having to release the enter button. It was a fun fix Bundyo, here's a diff:
Code:
Index: src/drawer.vala
===================================================================
--- src/drawer.vala	(revision 43)
+++ src/drawer.vala	(working copy)
@@ -78,11 +78,32 @@
 			this.timer_pending = true;
 		}
 	}
+
+	public bool set_goal_bool (  ) {
+		double goal = 1;
+		return_if_fail( this != null );
+		return_if_fail( goal >= 0 && goal <= 1 );
 	
+		if (goal == this.goal)
+	   		return false;
+	
+		if (goal == 0)
+			on_before_hide();
+		else
+			on_before_show();
+			
+		this.goal = goal;
+		if (this.timer_pending == false) {
+			this.timer_id = Timeout.add( this.period, on_timer );
+			this.timer_pending = true;
+		}
+		return false;
+	}
+	
 	public uint get_close_time() {
 		return_val_if_fail ( this != null, 0 );
 	
 		return this.period * ((uint)(1 / this.step) + 1);
 	}
 
-}
\ No newline at end of file
+}
Index: src/tearwebview.vala
===================================================================
--- src/tearwebview.vala	(revision 43)
+++ src/tearwebview.vala	(working copy)
@@ -49,12 +49,17 @@
 
 			case Gdk.KeySyms.Return:
 				if (!redo_keydown) {
-					this.enterdown = true;
+					if (options.get_option( "wake_toolbar_shortcut_speed" ) == "short") {
+						GLib.Timeout.add( 700, bw.drawer.set_goal_bool );
+					} else {
+						GLib.Timeout.add( 1400, bw.drawer.set_goal_bool );
+					}
+					/*this.enterdown = true;
 					entertime.get_current_time();
 					if (options.get_option( "wake_toolbar_shortcut_speed" ) == "short") {
 						last_keydown = ev;
 						return true;
-					}
+					}*/
 				} else 
 					redo_keydown = false;
(It's worth noting that I commented out some code that could be removed now. I also left in some code that can now be removed, but I'll let you take care of that )

daperl: Let's see if I remember everything...
  1. Install the SDK
  2. Enter the SDK and add extras-devel to your sources.list
  3. fakeroot apt-get install vala
  4. Grab the webkit package from the first post, and webkit-dev from http://bundyo.org/maemo/webkit/libwe...1137-8_all.deb
  5. Install said packages
  6. Install intltool
  7. Get the tear SVN
  8. Copy the folder /usr/include/gnome-vfs-2.0/libgnomevfs to /usr/include (So that /usr/include/libgnomevfs exists)
  9. cd to the downloaded SVN and run ./waf configure
  10. Install any needed -dev packages so that ./waf configure gives an "OK" message
  11. Run ./waf build
  12. You'll find the executable in (tear svn folder)/_build_/default/src/tear
I realize this is a VERY rough guide, but it should give you a good idea of what needs to be done. If you encounter any problems, post here and I'll help the best I can
__________________
Disclaimer: If a program I wrote doesn't work/breaks your tablet... It's not my fault
mcedit | Utility Calculators (WIP) | PyRDesktop
My Blog | Twitter

Last edited by TrueJournals; 2009-05-11 at 02:47.
 

The Following 3 Users Say Thank You to TrueJournals For This Useful Post:
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#226
There are two shell scripts in the tear folder, you can use them to copy and run tear directly on the tablet on build.
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#227
Originally Posted by TrueJournals View Post
Ah ha! Got it working! Had to copy the folder /usr/include/gnome-vfs-2.0/libgnomevfs to /usr/include (So that /usr/include/libgnomevfs exists). Note that this must be done within scratchbox. Is this a bug in the package that contains hildon-mime.h ?
Its not a bug, I just didn't want to make a VAPI for GnomeVFS too, since I don't use it.
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 

The Following User Says Thank You to Bundyo For This Useful Post:
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#228
Originally Posted by TrueJournals View Post
Code:
	public bool set_goal_bool (  ) {
		double goal = 1;
		return_if_fail( this != null );
		return_if_fail( goal >= 0 && goal <= 1 );
	
		if (goal == this.goal)
	   		return false;
	
		if (goal == 0)
			on_before_hide();
		else
			on_before_show();
			
		this.goal = goal;
		if (this.timer_pending == false) {
			this.timer_id = Timeout.add( this.period, on_timer );
			this.timer_pending = true;
		}
		return false;
	}
This part kinda worries me, since you're assigning 1 to goal in the beginning, you can remove at least half of the method
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 

The Following User Says Thank You to Bundyo For This Useful Post:
TrueJournals's Avatar
Posts: 480 | Thanked: 378 times | Joined on Apr 2008 @ Chicago-ish
#229
Originally Posted by Bundyo View Post
This part kinda worries me, since you're assigning 1 to goal in the beginning, you can remove at least half of the method
Yeah, it's a quick and dirty hack, really. The code needs some cleanup. But it works

[edit]Here's some cleaner code... I just hope I didn't remove anything I shouldn't have. It seems to work for me:
Code:
Index: src/drawer.vala
===================================================================
--- src/drawer.vala	(revision 43)
+++ src/drawer.vala	(working copy)
@@ -78,11 +78,27 @@
 			this.timer_pending = true;
 		}
 	}
+
+	public bool show_drawer ( ) {
+		return_if_fail( this != null );
 	
+		if (this.goal == 1)
+	   		return false;
+	
+		on_before_show();
+			
+		this.goal = 1;
+		if (this.timer_pending == false) {
+			this.timer_id = Timeout.add( this.period, on_timer );
+			this.timer_pending = true;
+		}
+		return false;
+	}
+	
 	public uint get_close_time() {
 		return_val_if_fail ( this != null, 0 );
 	
 		return this.period * ((uint)(1 / this.step) + 1);
 	}
 
-}
\ No newline at end of file
+}
Index: src/tearwebview.vala
===================================================================
--- src/tearwebview.vala	(revision 43)
+++ src/tearwebview.vala	(working copy)
@@ -31,13 +31,11 @@
 
 		this.clicking = false;
 		this.menudown = false;
-		this.redo_keydown = false;
 	}
 	
 	public bool on_webview_keydown (Tear.BrowserWindow bw, Gdk.EventKey ev) {
 		
 		this.menudown = false;
-		this.enterdown = false;
  
 		switch (ev.keyval) {
 			case Gdk.KeySyms.F4:
@@ -48,17 +46,13 @@
 				break;
 
 			case Gdk.KeySyms.Return:
-				if (!redo_keydown) {
-					this.enterdown = true;
-					entertime.get_current_time();
-					if (options.get_option( "wake_toolbar_shortcut_speed" ) == "short") {
-						last_keydown = ev;
-						return true;
-					}
-				} else 
-					redo_keydown = false;
+				if (options.get_option( "wake_toolbar_shortcut_speed" ) == "short")
+					GLib.Timeout.add( 500, bw.drawer.show_drawer );
+				else
+					GLib.Timeout.add( 1000, bw.drawer.show_drawer );
 				
 				break;
+				
 			case Gdk.KeySyms.Escape:
 				if (bw.web_view.can_go_back ())
 			    	bw.web_view.go_back ();
@@ -88,7 +82,7 @@
 
 	public bool on_webview_keyup (Tear.BrowserWindow bw, Gdk.EventKey ev) {
 		
-		if ((ev.keyval == Gdk.KeySyms.F4) || (ev.keyval == Gdk.KeySyms.Return)) {
+		if (ev.keyval == Gdk.KeySyms.F4) {
 			var newtime = TimeVal();
 			newtime.get_current_time();
 			
@@ -96,25 +90,7 @@
 				if ((newtime.tv_sec - menutime.tv_sec) < 1.0) 
 					program.get_common_menu().popup(null, null, MenuPosition, 0, get_current_event_time());
 
-			if (this.enterdown && options.get_option( "wake_toolbar_shortcut_speed" ) == "short") {
-				if ((newtime.tv_sec - entertime.tv_sec) < 0.7)
-					bw.drawer.set_goal( 1 );
-				else {
-					redo_keydown = true;
-					this.enterdown = false;
-					main_do_event( (Gdk.Event) last_keydown );
-				}
-			} else
-				if (this.enterdown && options.get_option( "wake_toolbar_shortcut_speed" ) == "long")
-					if ((newtime.tv_sec - entertime.tv_sec) > 0.5) {
-						bw.drawer.set_goal( 1 );
-						this.menudown = false;
-						this.enterdown = false;
-						return true;
-					}
-
 			this.menudown = false;
-			this.enterdown = false;
 
 			if (DEBUG)
 				warning ( "keyup" );
__________________
Disclaimer: If a program I wrote doesn't work/breaks your tablet... It's not my fault
mcedit | Utility Calculators (WIP) | PyRDesktop
My Blog | Twitter

Last edited by TrueJournals; 2009-05-11 at 14:30.
 

The Following User Says Thank You to TrueJournals For This Useful Post:
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#230
Diff for the latest libwebkit - from 41128 to 41137 + the applied patches + any changes.
http://bundyo.org/maemo/webkit/WebKi..._r41137-8.diff
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 

The Following User Says Thank You to Bundyo For This Useful Post:
Reply

Tags
browserd fix, microb killer, webkit


 
Forum Jump


All times are GMT. The time now is 07:42.