Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 17th, 2005, 8:28 PM   #1
stalefish
Newbie
 
stalefish's Avatar
 
Join Date: Feb 2005
Location: Finland
Posts: 2
Rep Power: 0 stalefish is on a distinguished road
Send a message via ICQ to stalefish Send a message via MSN to stalefish
Lightbulb Special browser in Java (Project)

Before I tell you anything at all, I have to mention that I'm not a coder, but a designer. I currently study IT and I'm trying to learn C/C++, and java is even more interesting, but the fact remains that I'm a designer, it can be quite difficult for me to code, I'm the person who comes up with good ideas, develops them and then searches for people to help.

Well then, with that out of my way, I'll go straight to the core. When I create web site, I use a not so usual style, I ONLY use <div> and CSS. The web site that I'm working on right now is the last site of mine that uses <div>, <img>, <a>, and CSS. This whole idea of a LUA/MO/DL browser (I'll tell you what that means a bit later ^-^) came from this unusual style of creating web sites. Since I only used <div>, <img>, <a>, and CSS, I became interested in creating a new markup language, one with only those four elements in it, and I called it MO, Minimal Objective. I asked around in forums how difficult it would be to create a markup language and an interpreter/browser for it. To my disappointment, it was far more complex and time consuming than I had expected, and noone was interested in helping me with the language either, so I gave up on the idea of MO.

Only 3 weeks ago I came up with an idea that I found really good, I would use PHP to create my language. I had read that you could practically create your own language using XNL, but I've never like XML and it all seemed so messy and unpractical that I gave up on the idea, but PHP really made me interested. So, using a lot of functions I soon had a small language where I could write:

image(image,40,40,$__images_dir.'image.png');

which would then be translated to HTML. I like this very much, it made the source code cleaner and smaller, and it was simply cool to have your own language, even if not a true language but only heavy use of functions in PHP (^-^).

Well, as I mentioned earlier, I soon dropped <img>, and later also <a>, so I was left with only <div>, which gave me my next idea, DL, Dynamic Layer. I still used <div>, <img>, <a>, and CSS for my web sites, but I had been working on MO, and now I started working on DL, so that I could later move over to using it for my web sites. DL also used PHP, but this time I used PHP only, I didn't even use css, everything was written in PHP, which would then be translated to HTML and CSS. This was even more interesting, and a whole lot more fun (^-^)! I have wanted to know programming for quite many years, but I've never really managed to learn anything, just simple stuff, so it was really fun to work with both MO and DL, it wasn't real coding, but it was still fun (^-^), it felt like real coding (^O^).

Well, the next step was when I started wondering wether it would work with LUA. PHP is nice, but it's server side, and not as small and fast as LUA, so I started looking into this. Using LUA to create HTML/CSS web sites turned out to be just as simple as using PHP, but with one problem, LUA wasn't supported by any browser as a client-side scripting language. So, as I use Firefox, I tried to make an extension for FF so that it would be able to use LUA as a client-side scripting language, but that proved to be diffidult for me. A few people helped me a bit over at irc.mozilla.org/#mozilla but I still didn't manage to create the extension. This made a bit sad, but I didn't stop working with LUA.

What happend next was the simple result of wanting to create my own language and being upset with how complex FF was (as if it wasn't enough that XML & XUL really was a mess, the FF API was also complex).

The idea originated from my use of only the <div> element to create web sites. My idea was to create a browser in Java that would use LUA as its markup language instead of HTML & CSS, and that it would be customisable like FF, but in a different way. The idea was that when you start the browser you would only see a white screen, completely empty, not even a titlebar, only an initialised Java window, and a small linux like console window. The main idea was that the user should be able to create her/his own browser, using MO and DL. MO&DL weren't the same languages anymore, but MO had become the language to control and create the browser, and DL became the very core of the browser, the language that you used to give the browser a interface, and also the markup language for the web sites. The empty Java screen was not actually empty, it just had nothing to show, this Java screen was like the window in any browser that displays the HTML content. Are you starting to get the point (^-^)?

Of course, by default the browser would have a nice and clean gui, but the best and most entertaining thing would be to create a new profile and start from scratch. So, by using a lot of global commands & functions, MO, and DL, you would be able to shape every part of the browser's gui. One of the first things you would do could be to create a dl layer to use a titlebar by writing this into the console:

make(dl,titlebar)

this would create an empty dl layer, and next you'd need to place it in the top of the screen and add some other properties.

add(1,add) titlebar = {position = 'top',
	width = '100pc',
	height = '20px',
	background = 000,
	layer = 0}

DL uses something very similar to CSS.

This would place the dl layer, in the top of the screen, and it would be 100% in width and 20px in height, and it would have a black background (DL uses only rgb for colours), and layer is the same as z-index, and 0 means the topmost layer. "addl" adds code to a line, and "add" adds code to an element. If adding to an element, "add" adds the code to the end of the element, to delete any previously entered code you would simply use "add(id,new)".

Next you could add a dl layer that displays the title of the document, and three other dl layers that function as minimize, maximize, and close buttons. Since both MO&DL are basically just LUA, all variables are global, so to display the title you wouldn't need to write anything else but "print(document.title)", and to make the buttons work you would use the global functions: __minimize(), __maximize(), and __exit(), and add this to the style for the dl layers: onClick = __minimize() and the other functions for respective dl layer.

All that these commands have done is to write code to the default page the browser opens on startup, "default.lua" and updating the java screen to display the changes.

The user can create any gui s/he likes by simply editing the default web page. Either through the console, or by opening the document in notepad or any other text editor.

All MO&DL documents can contain info on what the browser should look like, so to prevent that the gui changes every time the user visits a new web site (the sites don't need to have though), s/he can simply make a dl layer:

make(dl,container)
addl(2,add) container = {width = '100pc',
	height = '100pc',
	scrollbars = 'true',
	url = hompage}
add(container,add) homepage='http://www.google.com/'

and to be able to type the address we need an addressbar:

make(dl,addressbar)
addl(3,add) addressbar = {width = '100pc',
	height = '24px'}
add(addressbar,add) dl(input_url)
addl(4,add) input_url = {height = '22px',
	input = 'normal',
	send = url
	onSend = set(homepage,url)}
addl(5,add) preserve_gui = 'true'
addl(6,add) // new line at the end of each document

By giving the dl layer an input property it automatically becomes an input text field, and onSend is when you press enter. The screen is always updated on send, and now the homepage variable is set to the url entered in the addressbar, and thus displayed instead of the default web page which was google. The preserve_gui set to true simply ignores any code that would change the gui, and it also prompts the user if s/he wants to visit the current web page every time it notices gui code in the web page.

That's should give the basic idea of what this browser would be like (^-^), and I'm just as sure that there by now are a lot of people that think I'm completely insane (^.^). Well, as I mention earlier, I'm a designer, and although I'd love to be able to code all this myself, what I enjoy the most is to get to design the browser and the languages. As I mentioned earlier, the language used in the web pages is LUA, and the browser uses the LUA bins to translate into java or send necessary code to the program. So the code dl(layer1) would send the appropriate command to the java program to display an empty dl layer and give it the id "layer1". LUA is available to linux/mac/win, so this wouldn't be a problem.

Anyway, what I want to ask you after telling you this, is how difficult do you think it would be to create this? The dl layer basically behaves like the div layer (especially in position and dimension) so at one point I thought of using parts of the XBrowser code to create this. The java program would simply just need to be able to display the web page, communicate with lua, and have that small console...to put it very simply (^-^).

If you have any comments or question, just ask. I'm also looking for someone who would be willing to try to create something like this, as I only do the design part (^-^). This really isn't an attempt to create a new standard or anything, just a personal hobby, sort of, so I can't promise you any money or fame (^-^), just the pleasure of working on this project. I know this is very ambitious, so my expectations aren't very high...actually, I have no expectations at all (x-x), but it would be so fun to have this made (^-^).

And YES, I know, I'm a sucker for nice abbreviations (^O^)V !!

APPENDIX:
A slightly modified version of the example code I used could look like this:

document = {title = 'MO Example',
	author = 'Stalefish',
	description = 'MO Example',
	language = 'en-gb',
	encoding = 'iso-8859-1',
	copyright = '© Stalefish, 2005 All rights reserved.',
	keywords = 'lua,mo,dl,example'}

homepage = 'http://www.google.com/'
preserve_gui = 'true'

titlebar = {position = 'top',
	width = '100pc',
	height = '20px',
	background = 000,
	layer = 0}
addressbar = {width = '100pc',
	height = '24px'}
input_url = {width = '100pc',
	height = '22px',
	input = 'normal',
	send = url,
	onSend = set(homepage,url)}
container = {width = '100pc',
	height = '100pc',
	scrollbars = 'true',
	url = homepage}

dl(titlebar)
	print(document.title)
endl(titlebar)

dl(addressbar)
	dl(input_url)
	endl(input_url)
endl(addressbar)

dl(container)
endl(container)

Last edited by stalefish; Feb 17th, 2005 at 8:32 PM.
stalefish is offline   Reply With Quote
Old Feb 18th, 2005, 8:49 AM   #2
stalefish
Newbie
 
stalefish's Avatar
 
Join Date: Feb 2005
Location: Finland
Posts: 2
Rep Power: 0 stalefish is on a distinguished road
Send a message via ICQ to stalefish Send a message via MSN to stalefish
Crap!! it's way too much...I'm just going to use HTML and make the browser myself, I have Netbeans and JBuilder, I should be ok. I'll post the program if I manage to get it working (^-^) Then you'll see what my idea was.
stalefish is offline   Reply With Quote
Old Feb 19th, 2005, 11:49 AM   #3
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
That has to be the longest post in these forums, ever. Congratumalations.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Feb 9th, 2008, 4:22 PM   #4
littlejim4
Newbie
 
Join Date: Dec 2007
Location: South Wales
Posts: 4
Rep Power: 0 littlejim4 is on a distinguished road
Re: Special browser in Java (Project)

My god you have really worked on this, cracking idea but many users just want to "plug and play" without having to know much of the workings. I like the idea though IE7 is already looking a bit old and tired if you know what I mean. I think that the java way to go is probably the best even though I'm a VB man at heart java is by far the easier to work with and it's multi-platform so that issue is right out the window. Let us know how you get on.
littlejim4 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:45 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC