Lisp HUG Maillist Archive

REF: Re: html rendering in capi...

Thanks for the tip Jochen, i have looked at the com example but since i don't have experience with COM i'll need to play with it before it does what i need. 

-- msg. original --
Assunto:	Re: html rendering in capi...
De:	Jochen Schmidt <jsc@crispylogics.com>
Data:		31.12.2008 16:45


Am 31.12.2008 um 17:00 schrieb Alexandre Paes:

>
> Hi everyone,
>
> does anyone know any way of rendering html in capi? I've gone  
> through the ml archive and found a reference about embedding webkit  
> webview in a cocoa capi pane but i'd need a way to render html on  
> lww professional.

You can embed IE via COM - I think there is also something about that  
in the COM examples.

--
Jochen Schmidt
CRISPYLOGICS
Uhlandstr. 9 , 90408 Nuremberg

Fon +49 (0)911 517 999 82
Fax +49 (0)911 517 999 83

mailto:info@crispylogics.com
http://www.crispylogics.com



Re: REF: Re: html rendering in capi...

Hi, thanks for a hint. I found this example that works fine on my Mac 
LispWorks 5 Pro.

(defmacro @ (&body body) `(objc:invoke ,@body))
(defmacro @into (&body body) `(objc:invoke-into ,@body))
(defmacro @pool (&body body) `(objc:with-autorelease-pool () ,@body))

(defun framework-path-list ()
   (@pool
     (loop with framework-vector = (@into 'array "NSBundle" "allFrameworks")
           for elt across framework-vector collect (@into 'string elt 
"bundlePath"))))

(defun load-webkit ()
   (@pool
     (@ (@ "NSBundle" "bundleWithPath:"
          (@ (@ "NSString" "stringWithString:" 
"/System/Library/Frameworks/WebKit.framework/")
            "stringByStandardizingPath"))
       "load")))

(defun load-framework (framework-path-string)
   (@pool
     (@ (@ "NSBundle" "bundleWithPath:"
          (@ (@ "NSString" "stringWithString:" framework-path- string) 
"stringByStandardizingPath"))
       "load")))

(defun get-web-view (url)
   (@pool
     (let* ((request
             (@ "NSURLRequest" "requestWithURL:" (@ "NSURL" 
"URLWithString:" url)))
            (web-view
             (make-instance 'capi:cocoa-view-pane :view-class "WebView"
                            :init-function
                            #'(lambda (pane view)
                                (setq view (@ view "init"))
                                (@ (@ view "mainFrame") "loadRequest:" request)
                                view))))
       (capi:contain web-view)
       web-view)))

(load-webkit)
(framework-path-list)
(get-web-view "http://www.apple.com")

---

Pekka


>Thanks for the tip Jochen, i have looked at the com example but 
>since i don't have experience with COM i'll need to play with it 
>before it does what i need.
>
>-- msg. original --
>Assunto:	Re: html rendering in capi...
>De:	Jochen Schmidt <jsc@crispylogics.com>
>Data:		31.12.2008 16:45
>
>
>Am 31.12.2008 um 17:00 schrieb Alexandre Paes:
>
>>
>>  Hi everyone,
>>
>>  does anyone know any way of rendering html in capi? I've gone 
>>  through the ml archive and found a reference about embedding webkit 
>>  webview in a cocoa capi pane but i'd need a way to render html on 
>>  lww professional.
>
>You can embed IE via COM - I think there is also something about that 
>in the COM examples.
>
>--
>Jochen Schmidt
>CRISPYLOGICS
>Uhlandstr. 9 , 90408 Nuremberg
>
>Fon +49 (0)911 517 999 82
>Fax +49 (0)911 517 999 83
>
>mailto:info@crispylogics.com
>http://www.crispylogics.com


Re: REF: Re: html rendering in capi...


On Jan 2, 2009, at 11:35 AM, Jochen Schmidt wrote:

> A Sidenote:
> The Objective-C bridge in LispWorks is so incredible well done that  
> it is a real pleasure to work with. There is a project called  
> "Cocotron" which is a free implementation of many parts of Cocoa for  
> Windows and Linux. It would be interesting to have the Objective-C  
> bridge on Windows and Linux too, so that one could use libraries  
> like Cocotron or perhaps GNUStep. I don't know how much effort is  
> needed for this or if there is a broader interest than just me.

Wow - this would be amazing. I'm not sure if the .nib file integration  
is absolutely essential (though of course it would be really useful  
and cool as well). But having the equivalent of a capi-cocoa-view-pane  
on Windows would make my life a lot easier as well.

Happy New Year and Warmest Regards,

Ralph





Raffael Cavallaro, Ph.D.
raffaelcavallaro@mac.com


Re: REF: Re: html rendering in capi...

I have lots of documentation that could be easy to translate to HTML 
(automatically, from the ASCII files), but would require huge work to 
make publishing quality docs within LW. The documents need also 
evaluation that would dynamically fill up the HTML template with 
graphs.

Also, the user should be able to evaluate selection on the HTML page 
.... integrated LW editor & listener pane with COCOA functionality 
would be cool.

I tried mixin capi:cocoa-view-pane + 
listener-pane/interactive-pane/editor-pane in order to be able to 
just copy text from the web-view pane --> error.

Maybe there is another solution. Now it looks like that the best you 
can get is to have LW menus and buttons that set up a new web page on 
the web-view pane.

Pekka

>Am 02.01.2009 um 17:05 schrieb Pekka Tolonen:
>
>>
>>Hi, thanks for a hint. I found this example that works fine on my 
>>Mac LispWorks 5 Pro.
>
>Yes there is also an example of using webkit in LW5 Pro for Mac OS 
>X. Actually I would be happy to use webkit in LWW (and LWL) too.
>Since Chrome has shown that it runs quite well on windows I think 
>that this could really be an interesting thing.
>
>I will need an integrated HTML browser in at least one of my 
>products. Until now there are only some examples using COM (IE) and 
>Cocoa (Webkit). Having a well done and transparently integrated HTML 
>view within CAPI could be very valuable. One could not only use it 
>to display actual websites but also use the very sophisticated 
>rendering engines to create rich user interfaces (Think iTunes 
>Store). AFAIK even Apples wordprocessor "Pages" is built using 
>Webkit. Often it is much easier to translate some documents into 
>HTML and then just show them in an HTML view instead of creating a 
>new view from scratch.
>
>A Sidenote:
>The Objective-C bridge in LispWorks is so incredible well done that 
>it is a real pleasure to work with. There is a project called 
>"Cocotron" which is a free implementation of many parts of Cocoa for 
>Windows and Linux. It would be interesting to have the Objective-C 
>bridge on Windows and Linux too, so that one could use libraries 
>like Cocotron or perhaps GNUStep. I don't know how much effort is 
>needed for this or if there is a broader interest than just me. I 
>think it would be cool and useful - one could even build GUIs using 
>NIB files created with the XCode Interface Builder.
>
>Another Sidenote:
>My main development and product platform is Mac OS X - It would be 
>really nice to see more integration of Cocoa and CAPI in future. I 
>think it's actually quite cool to be able to use Cocoa-Views within 
>CAPI-panes - but could also imagine the opposite: Using a CAPI pane 
>within a (Interface Builder constructed) Cocoa-View. Just think 
>about embedding the LispWorks-Editor in an application that uses a 
>NIB-based Cocoa-GUI.
>
>ciao,
>Jochen
>
>>
>>
>>(defmacro @ (&body body) `(objc:invoke ,@body))
>>(defmacro @into (&body body) `(objc:invoke-into ,@body))
>>(defmacro @pool (&body body) `(objc:with-autorelease-pool () ,@body))
>>
>>(defun framework-path-list ()
>>  (@pool
>>    (loop with framework-vector = (@into 'array "NSBundle" "allFrameworks")
>>          for elt across framework-vector collect (@into 'string elt 
>>"bundlePath"))))
>>
>>(defun load-webkit ()
>>  (@pool
>>    (@ (@ "NSBundle" "bundleWithPath:"
>>         (@ (@ "NSString" "stringWithString:" 
>>"/System/Library/Frameworks/WebKit.framework/")
>>           "stringByStandardizingPath"))
>>      "load")))
>>
>>(defun load-framework (framework-path-string)
>>  (@pool
>>    (@ (@ "NSBundle" "bundleWithPath:"
>>         (@ (@ "NSString" "stringWithString:" framework-path- 
>>string) "stringByStandardizingPath"))
>>      "load")))
>>
>>(defun get-web-view (url)
>>  (@pool
>>    (let* ((request
>>            (@ "NSURLRequest" "requestWithURL:" (@ "NSURL" 
>>"URLWithString:" url)))
>>           (web-view
>>            (make-instance 'capi:cocoa-view-pane :view-class "WebView"
>>                           :init-function
>>                           #'(lambda (pane view)
>>                               (setq view (@ view "init"))
>>                               (@ (@ view "mainFrame") "loadRequest:" request)
>>                               view))))
>>      (capi:contain web-view)
>>      web-view)))
>>
>>(load-webkit)
>>(framework-path-list)
>>(get-web-view "http://www.apple.com")
>>
>>---
>>
>>Pekka
>>
>>>Thanks for the tip Jochen, i have looked at the com example but 
>>>since i don't have experience with COM i'll need to play with it 
>>>before it does what i need.
>>>
>>>-- msg. original --
>>>Assunto:	Re: html rendering in capi...
>>>De:	Jochen Schmidt <jsc@crispylogics.com>
>>>Data:		31.12.2008 16:45
>>>
>>>
>>>Am 31.12.2008 um 17:00 schrieb Alexandre Paes:
>>>
>>>>
>>>>Hi everyone,
>>>>
>>>>does anyone know any way of rendering html in capi? I've gone  
>>>>through the ml archive and found a reference about embedding 
>>>>webkit  webview in a cocoa capi pane but i'd need a way to render 
>>>>html on  lww professional.
>>>
>>>You can embed IE via COM - I think there is also something about 
>>>that in the COM examples.
>>>
>>>--
>>>Jochen Schmidt
>>>CRISPYLOGICS
>>>Uhlandstr. 9 , 90408 Nuremberg
>>>
>>>Fon +49 (0)911 517 999 82
>>>Fax +49 (0)911 517 999 83
>>>
>>>mailto:info@crispylogics.com
>>>http://www.crispylogics.com
>>
>
>--
>Jochen Schmidt
>CRISPYLOGICS
>Uhlandstr. 9 , 90408 Nuremberg
>
>Fon +49 (0)911 517 999 82
>Fax +49 (0)911 517 999 83
>
>mailto:info@crispylogics.com
>http://www.crispylogics.com


Updated at: 2020-12-10 08:41 UTC