[fpc-pascal] Network compression

2017-05-23 Thread Dimitrios Chr. Ioannidis via fpc-pascal

Hi,

  I need to transfer data which are relative big ( 1,2 GB )using low 
memory ( 512MB, 1GB RAM ) machines.


  I was thinking something like load partial the file I ie.e a 64K 
memory block ) compress it send that compressed block via network and at 
the other end receive that block decompressed it and write it to disk, 
"repeat until done" .


  I've searched but I didn't find any example on how to compress / 
decompress in blocks .


  Any hints ?

regards,

--
Dimitrios Chr. Ioannidis
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Network compression

2017-05-23 Thread Graeme Geldenhuys

On 2017-05-23 09:52, Dimitrios Chr. Ioannidis via fpc-pascal wrote:

   I've searched but I didn't find any example on how to compress /
decompress in blocks .


Take a look at how it is done in tiOPF. The unit is pretty stand-alone, 
so you don’t need to use the rest of tiOPF to make use of this unit.



https://sourceforge.net/p/tiopf/code/ci/tiopf2/tree/Options/tiCompressZLib.pas

The code should be self explanatory. There is even a tiCompressNone.pas 
which is great for testing purposes.


If you still don’t know how to use the unit, take a look at the unit 
tests, in the “UnitTests” directory, for detailed usage examples.


Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC Graphics options?

2017-05-23 Thread Graeme Geldenhuys

On 2017-05-22 23:11, nore...@z505.com wrote:

What happens if you use the SVN bridge that allows you to run svn
commands to a git server? does git suffer the same problems in this mode
too?


Replied in "fpc-other" mailing list.

Regards,
  Graeme

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Network compression

2017-05-23 Thread Adriaan van Os

Dimitrios Chr. Ioannidis via fpc-pascal wrote:

Hi,

  I need to transfer data which are relative big ( 1,2 GB )using low 
memory ( 512MB, 1GB RAM ) machines.


The fastest compressor to do the job is LZ4 .

Regards,

Adriaan van Os

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Browser and exe

2017-05-23 Thread Marcos Douglas B. Santos
On Tue, May 23, 2017 at 6:23 AM, leledumbo via fpc-pascal
 wrote:
>> Is there a way to call an Exe (previously installed, no problem with that)
> to interact with an Exe, working in IE and Chrome?
>
> Not from client side AFAIK. You'll need to create a local server side app,
> let that one executes the exe and response back to the client (if needed).

I need to call an EXE in client site. For example: digital signature.
The client would use his token to sign a document (locally) and then
send to the Web app.

Best regards,
Marcos Douglas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Browser and exe

2017-05-23 Thread Felipe Monteiro de Carvalho
That's why Model-View-Controller is such a great design pattern. If
you use MVC you can simply create a new View component and keep the
Model and Controller without changes.

You can use fcl-web to write the web server:
http://wiki.lazarus.freepascal.org/fcl-web

You will need to rewrite the GUI in html/javascript which is served to
the web browser.

In the past there was stuff like ActiveX and a Java similar, but
nowadays they are pretty much all deprecated sometimes even
unsupported at all, people should use html+javascript for web
interfaces.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Browser and exe

2017-05-23 Thread Felipe Monteiro de Carvalho
On Tue, May 23, 2017 at 2:39 PM, Marcos Douglas B. Santos
 wrote:
> I can't. For security reasons I need to have an app installed on client.
> Did you see my email before, about digital signature? That is one of
> these features...

In this case I have no idea how it is done. But it can be done, I know
that Banco Itau does this, but I don't know what exactly they use.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Browser and exe

2017-05-23 Thread Marcos Douglas B. Santos
On Tue, May 23, 2017 at 8:04 AM, Felipe Monteiro de Carvalho
 wrote:
> That's why Model-View-Controller is such a great design pattern. If
> you use MVC you can simply create a new View component and keep the
> Model and Controller without changes.
>
> You can use fcl-web to write the web server:
> http://wiki.lazarus.freepascal.org/fcl-web

I've been written Web applications using fcl-web for a while... this
isn't my problem.

> You will need to rewrite the GUI in html/javascript which is served to
> the web browser.

I can't. For security reasons I need to have an app installed on client.
Did you see my email before, about digital signature? That is one of
these features...

> In the past there was stuff like ActiveX and a Java similar, but
> nowadays they are pretty much all deprecated sometimes even
> unsupported at all, people should use html+javascript for web
> interfaces.

ActiveX works but as you said, all these are deprecated...

I will take a look on NativeMessaging:
https://developer.chrome.com/extensions/nativeMessaging

Another option, that I thought, is make an app that is a local web
server after the user has installed.
The web real app could make requests to http//localhost and have a
communication between them.

Best regards,
Marcos Douglas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Browser and exe

2017-05-23 Thread Marcos Douglas B. Santos
On Tue, May 23, 2017 at 10:34 AM, Felipe Monteiro de Carvalho
 wrote:
> On Tue, May 23, 2017 at 2:39 PM, Marcos Douglas B. Santos
>  wrote:
>> I can't. For security reasons I need to have an app installed on client.
>> Did you see my email before, about digital signature? That is one of
>> these features...
>
> In this case I have no idea how it is done. But it can be done, I know
> that Banco Itau does this, but I don't know what exactly they use.

This idea. I think Banco do Brasil does this too.
Maybe if I develop an Extension for the browser (I need Chrome and IE)
would be simpler but I don't know how to do this yet.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC Graphics options?

2017-05-23 Thread Nikolay Nikolov



On 05/23/2017 06:09 PM, James Richters wrote:

I think I figured out my problem, but I'm not sure how to fix it.   I was 
looking at the code here: https://sourceforge.net/p/ptcpas/code/714/
And I see that the change made was to win32kbd.inc, but I don't think I'm using 
the updated version of it.   I think my problem is that I just compiled 
ptcgraph.pp and replaced ptcgraph.ppu in FPCWin\units\i386-win32\graph so 
apparently that's not the correct way to do it.So then I tried adding the 
entire folder downloaded from https://sourceforge.net/projects/ptcpas/files/
But that's a fix, that's not yet released (because it needs testing), so 
it's in svn trunk only, and not in the release files. Get it from:


 https://sourceforge.net/p/ptcpas/code/HEAD/tree/trunk/

Either click on "Download Snapshot", or install subversion (TortoiseSVN) 
and checkout https://svn.code.sf.net/p/ptcpas/code/trunk



Into a folder at FPCWin\units\i386-win32\ptcpas  then renaming the original 
ptccrt.ppu and ptcgraph.ppu located in FPCWin\units\i386-win32\graph but now It 
can't find ptcgraph, even though it's there under  
FPCWin\units\i386-win32\ptcpas\ptcgraph so now I'm realizing that I'm just 
guessing and really don't have a clue the proper way to integrate this into my 
fpc compiler.

Could someone please tell me the correct way I should be doing this so that the 
compiler will find the correct versions of all the files necessary?

James


-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
James Richters
Sent: Monday, May 22, 2017 7:13 PM
To: 'FPC-Pascal users discussions' 
Subject: Re: [fpc-pascal] FPC Graphics options?


Here is a simple sample program that has the issue for me on both my windows 10 
desktop and my windows 10 laptop, both are 64bit.
https://hastebin.com/nubonozaho.pas

I started thinking about this, and did some more tests, and I think I have 
narrowed down what is really happening, but not sure how to fix it.

The problem is not the ALT-tab from the graphics window,  it's ALT being 
pressed when the window focus changes.   CTRL is also affected, but not shift.  
Try this:
Go to Graph window,  type some letters,  see that it's working correctly,  now 
hold just ALT, or CTRL - switch to another window by clicking on it.  Click on 
console window, see letters are working correctly, now go back to graph window, 
 anything you press acts like ALT, or CTRL is still being pressed until you 
actually enter a keystroke using ALT, or CTRL.   It seems to me there is 
probably some flag or variable being set that the alt or ctrl key is being 
pressed, but is being interrupted by the window focus change, when focus is 
brought back, the variable is still set for ALT or CTRL being down, but neither 
is down anymore, but the flag cannot be cleared until a key sequence using ctrl 
or alt is used.  I did also notice that just hitting alt or ctrl and releasing 
it in the graph window clears the condition and characters are back to normal 
again.

James


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org 
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC Graphics options?

2017-05-23 Thread James Richters
I think I figured out my problem, but I'm not sure how to fix it.   I was 
looking at the code here: https://sourceforge.net/p/ptcpas/code/714/
And I see that the change made was to win32kbd.inc, but I don't think I'm using 
the updated version of it.   I think my problem is that I just compiled 
ptcgraph.pp and replaced ptcgraph.ppu in FPCWin\units\i386-win32\graph so 
apparently that's not the correct way to do it.So then I tried adding the 
entire folder downloaded from https://sourceforge.net/projects/ptcpas/files/
Into a folder at FPCWin\units\i386-win32\ptcpas  then renaming the original 
ptccrt.ppu and ptcgraph.ppu located in FPCWin\units\i386-win32\graph but now It 
can't find ptcgraph, even though it's there under  
FPCWin\units\i386-win32\ptcpas\ptcgraph so now I'm realizing that I'm just 
guessing and really don't have a clue the proper way to integrate this into my 
fpc compiler.

Could someone please tell me the correct way I should be doing this so that the 
compiler will find the correct versions of all the files necessary? 

James


-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
James Richters
Sent: Monday, May 22, 2017 7:13 PM
To: 'FPC-Pascal users discussions' 
Subject: Re: [fpc-pascal] FPC Graphics options?

>Here is a simple sample program that has the issue for me on both my windows 
>10 desktop and my windows 10 laptop, both are 64bit.
>https://hastebin.com/nubonozaho.pas

I started thinking about this, and did some more tests, and I think I have 
narrowed down what is really happening, but not sure how to fix it.   

The problem is not the ALT-tab from the graphics window,  it's ALT being 
pressed when the window focus changes.   CTRL is also affected, but not shift.  
Try this:
Go to Graph window,  type some letters,  see that it's working correctly,  now 
hold just ALT, or CTRL - switch to another window by clicking on it.  Click on 
console window, see letters are working correctly, now go back to graph window, 
 anything you press acts like ALT, or CTRL is still being pressed until you 
actually enter a keystroke using ALT, or CTRL.   It seems to me there is 
probably some flag or variable being set that the alt or ctrl key is being 
pressed, but is being interrupted by the window focus change, when focus is 
brought back, the variable is still set for ALT or CTRL being down, but neither 
is down anymore, but the flag cannot be cleared until a key sequence using ctrl 
or alt is used.  I did also notice that just hitting alt or ctrl and releasing 
it in the graph window clears the condition and characters are back to normal 
again.

James


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org 
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC Graphics options?

2017-05-23 Thread wkitty42

On 05/22/2017 07:13 PM, James Richters wrote:

The problem is not the ALT-tab from the graphics window,  it's ALT being
pressed when the window focus changes.   CTRL is also affected, but not
shift.
this is really sounding like a problem i remember from early GUIs several 
decades ago... when switching tasks, the state of the CTRL or ALT or SHIFT keys 
would ""get stuck""... when returning, things weren't right but tapping the 
CTRL, ALT and/or SHIFT keys a few times would return them to their proper state...


i remember the problem but am not aware of the fix... i know i dealt with it on 
OS/2 as well as winwhatever... we just got into the habit of tapping those keys 
when we returned...


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list unless*
   *a signed and pre-paid contract is in effect with us.*
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] [FPC-Pascal] FPC Graphics options?

2017-05-23 Thread Ewald
On 23/05/17 19:50, James Richters wrote:
> *correction  to directory names:
> Now I got an error that it could not find graphh.inc So I copied all the .inc 
> files from J:\Programming\FPC 3.0.2\units\i386-win32\ptcpas\ptcgraph\inc  to 
> J:\Programming\FPC 3.0.2\units\i386-win32\ptcpas\ptcgraph because I have no 
> idea how else to make it find them.

Just like you now use -FuSomePath to tell the compiler where to find
units, you can use -FiSomePath to tell the compiler where to look for
include files.

See `fpc -h`, under the section "-F Set file names and paths:" for a
list of other related switches.


-- 
Ewald
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] [FPC-Pascal] FPC Graphics options?

2017-05-23 Thread James Richters
>all i get is a dark blue screen there... no text or anything that i can see to 
>download or copy...

That's strange.. it worked yesterday but not today, I tried to create it again 
with hastebin but it's not working.   here is a new link using pastebin instead
https://pastebin.com/3ARG0zQU

James

-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
wkitt...@windstream.net
Sent: Tuesday, May 23, 2017 2:16 PM
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] [FPC-Pascal] FPC Graphics options?

On 05/22/2017 05:38 PM, James Richters wrote:
>> I cannot reproduce it on my machine after the r714 fix. Can you send 
>> me a small example program, that demonstrates the problem, as well as 
>> detailed steps to reproduce? >
> Here is a simple sample program that has the issue for me on both my 
> windows
> 10 desktop and my windows 10 laptop, both are 64bit. > 
> https://hastebin.com/nubonozaho.pas

all i get is a dark blue screen there... no text or anything that i can see to 
download or copy...

--
  NOTE: No off-list assistance is given without prior approval.
*Please keep mailing list traffic on the list unless*
*a signed and pre-paid contract is in effect with us.* 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org 
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC Graphics options?

2017-05-23 Thread James Richters
I have done the "download snapshot" but I just don't know what to do with it 
now to properly integrate it into my compiler.  

Here is what I have tried to do.
First I moved everything from J:\Programming\FPC 3.0.2\units\i386-win32\graph 
to a temporary location so it wouldn't find the old versions of ptcgraph and 
ptccrt
Now when I try to compile my program, I get unit ptcgraph not found... which is 
what I want because I want to be sure not to get the old version
Then I copied the entire snapshot to into J:\Programming\FPC 
3.0.2\units\i386-win32\ptcpas
Now when I try to compile my program, I still get unit ptcgraph not found.
I added J:\Programming\FPC 3.0.2\units\$fpctarget\ptcpas\* to the directories
Now I got an error that it could not find graphh.inc 
So I copied all the .inc files from J:\Programming\FPC 
3.0.2\units\i386-win32\graph\inc to J:\Programming\FPC 
3.0.2\units\i386-win32\graph because I have no idea how else to make it find 
them.
Now I can can compile successfully and run my program, but it has the same 
issues.
But I notice the modified file win32kbd.inc is never used.   I have even 
removed it temporarily and I can still compile successfully.  I did a 
search for win32kbd and I find win32kbdd.inc but not win32kbd.inc

That is where I am at.  I think If I could correctly apply win32kbd.inc it may 
work

James



-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
Nikolay Nikolov
Sent: Tuesday, May 23, 2017 1:03 PM
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] FPC Graphics options?



On 05/23/2017 06:09 PM, James Richters wrote:
> I think I figured out my problem, but I'm not sure how to fix it.   I was 
> looking at the code here: https://sourceforge.net/p/ptcpas/code/714/
> And I see that the change made was to win32kbd.inc, but I don't think I'm 
> using the updated version of it.   I think my problem is that I just compiled 
> ptcgraph.pp and replaced ptcgraph.ppu in FPCWin\units\i386-win32\graph so 
> apparently that's not the correct way to do it.So then I tried adding the 
> entire folder downloaded from https://sourceforge.net/projects/ptcpas/files/
But that's a fix, that's not yet released (because it needs testing), so it's 
in svn trunk only, and not in the release files. Get it from:

  https://sourceforge.net/p/ptcpas/code/HEAD/tree/trunk/

Either click on "Download Snapshot", or install subversion (TortoiseSVN) and 
checkout https://svn.code.sf.net/p/ptcpas/code/trunk

> Into a folder at FPCWin\units\i386-win32\ptcpas  then renaming the original 
> ptccrt.ppu and ptcgraph.ppu located in FPCWin\units\i386-win32\graph but now 
> It can't find ptcgraph, even though it's there under  
> FPCWin\units\i386-win32\ptcpas\ptcgraph so now I'm realizing that I'm just 
> guessing and really don't have a clue the proper way to integrate this into 
> my fpc compiler.
>
> Could someone please tell me the correct way I should be doing this so that 
> the compiler will find the correct versions of all the files necessary?
>
> James
>
>
> -Original Message-
> From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On 
> Behalf Of James Richters
> Sent: Monday, May 22, 2017 7:13 PM
> To: 'FPC-Pascal users discussions' 
> Subject: Re: [fpc-pascal] FPC Graphics options?
>
>> Here is a simple sample program that has the issue for me on both my windows 
>> 10 desktop and my windows 10 laptop, both are 64bit.
>> https://hastebin.com/nubonozaho.pas
> I started thinking about this, and did some more tests, and I think I have 
> narrowed down what is really happening, but not sure how to fix it.
>
> The problem is not the ALT-tab from the graphics window,  it's ALT being 
> pressed when the window focus changes.   CTRL is also affected, but not 
> shift.  Try this:
> Go to Graph window,  type some letters,  see that it's working correctly,  
> now hold just ALT, or CTRL - switch to another window by clicking on it.  
> Click on console window, see letters are working correctly, now go back to 
> graph window,  anything you press acts like ALT, or CTRL is still being 
> pressed until you actually enter a keystroke using ALT, or CTRL.   It seems 
> to me there is probably some flag or variable being set that the alt or ctrl 
> key is being pressed, but is being interrupted by the window focus change, 
> when focus is brought back, the variable is still set for ALT or CTRL being 
> down, but neither is down anymore, but the flag cannot be cleared until a key 
> sequence using ctrl or alt is used.  I did also notice that just hitting alt 
> or ctrl and releasing it in the graph window clears the condition and 
> characters are back to normal again.
>
> James
>
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org 
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
> 

Re: [fpc-pascal] [FPC-Pascal] FPC Graphics options?

2017-05-23 Thread wkitty42

On 05/22/2017 05:38 PM, James Richters wrote:

I cannot reproduce it on my machine after the r714 fix. Can you send me a
small example program, that demonstrates the problem, as well as detailed
steps to reproduce? >

Here is a simple sample program that has the issue for me on both my windows
10 desktop and my windows 10 laptop, both are 64bit. > 
https://hastebin.com/nubonozaho.pas


all i get is a dark blue screen there... no text or anything that i can see to 
download or copy...


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list unless*
   *a signed and pre-paid contract is in effect with us.*
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC Graphics options?

2017-05-23 Thread Nikolay Nikolov



On 05/23/2017 08:28 PM, James Richters wrote:

I have done the "download snapshot" but I just don't know what to do with it 
now to properly integrate it into my compiler.
Follow the instructions in docs/INSTALL.txt to compile the package. Then 
add units\i386-win32 from the snapshot directory to the unit search path 
of your compiler.


Here is what I have tried to do.
First I moved everything from J:\Programming\FPC 3.0.2\units\i386-win32\graph 
to a temporary location so it wouldn't find the old versions of ptcgraph and 
ptccrt
Now when I try to compile my program, I get unit ptcgraph not found... which is 
what I want because I want to be sure not to get the old version
Then I copied the entire snapshot to into J:\Programming\FPC 
3.0.2\units\i386-win32\ptcpas
Now when I try to compile my program, I still get unit ptcgraph not found.
I added J:\Programming\FPC 3.0.2\units\$fpctarget\ptcpas\* to the directories
Now I got an error that it could not find graphh.inc
So I copied all the .inc files from J:\Programming\FPC 
3.0.2\units\i386-win32\graph\inc to J:\Programming\FPC 
3.0.2\units\i386-win32\graph because I have no idea how else to make it find 
them.
Now I can can compile successfully and run my program, but it has the same 
issues.
But I notice the modified file win32kbd.inc is never used.   I have even 
removed it temporarily and I can still compile successfully.  I did a 
search for win32kbd and I find win32kbdd.inc but not win32kbd.inc

That is where I am at.  I think If I could correctly apply win32kbd.inc it may 
work

James



-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
Nikolay Nikolov
Sent: Tuesday, May 23, 2017 1:03 PM
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] FPC Graphics options?



On 05/23/2017 06:09 PM, James Richters wrote:

I think I figured out my problem, but I'm not sure how to fix it.   I was 
looking at the code here: https://sourceforge.net/p/ptcpas/code/714/
And I see that the change made was to win32kbd.inc, but I don't think I'm using 
the updated version of it.   I think my problem is that I just compiled 
ptcgraph.pp and replaced ptcgraph.ppu in FPCWin\units\i386-win32\graph so 
apparently that's not the correct way to do it.So then I tried adding the 
entire folder downloaded from https://sourceforge.net/projects/ptcpas/files/

But that's a fix, that's not yet released (because it needs testing), so it's 
in svn trunk only, and not in the release files. Get it from:

   https://sourceforge.net/p/ptcpas/code/HEAD/tree/trunk/

Either click on "Download Snapshot", or install subversion (TortoiseSVN) and 
checkout https://svn.code.sf.net/p/ptcpas/code/trunk


Into a folder at FPCWin\units\i386-win32\ptcpas  then renaming the original 
ptccrt.ppu and ptcgraph.ppu located in FPCWin\units\i386-win32\graph but now It 
can't find ptcgraph, even though it's there under  
FPCWin\units\i386-win32\ptcpas\ptcgraph so now I'm realizing that I'm just 
guessing and really don't have a clue the proper way to integrate this into my 
fpc compiler.

Could someone please tell me the correct way I should be doing this so that the 
compiler will find the correct versions of all the files necessary?

James


-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On
Behalf Of James Richters
Sent: Monday, May 22, 2017 7:13 PM
To: 'FPC-Pascal users discussions' 
Subject: Re: [fpc-pascal] FPC Graphics options?


Here is a simple sample program that has the issue for me on both my windows 10 
desktop and my windows 10 laptop, both are 64bit.
https://hastebin.com/nubonozaho.pas

I started thinking about this, and did some more tests, and I think I have 
narrowed down what is really happening, but not sure how to fix it.

The problem is not the ALT-tab from the graphics window,  it's ALT being 
pressed when the window focus changes.   CTRL is also affected, but not shift.  
Try this:
Go to Graph window,  type some letters,  see that it's working correctly,  now 
hold just ALT, or CTRL - switch to another window by clicking on it.  Click on 
console window, see letters are working correctly, now go back to graph window, 
 anything you press acts like ALT, or CTRL is still being pressed until you 
actually enter a keystroke using ALT, or CTRL.   It seems to me there is 
probably some flag or variable being set that the alt or ctrl key is being 
pressed, but is being interrupted by the window focus change, when focus is 
brought back, the variable is still set for ALT or CTRL being down, but neither 
is down anymore, but the flag cannot be cleared until a key sequence using ctrl 
or alt is used.  I did also notice that just hitting alt or ctrl and releasing 
it in the graph window clears the condition and characters are back to normal 
again.

James


___
fpc-pascal maillist  -  

Re: [fpc-pascal] FPC Graphics options?

2017-05-23 Thread James Richters
>Follow the instructions in docs/INSTALL.txt to compile the package. Then add 
>units\i386-win32 from the snapshot directory to the unit search path of your 
>compiler.

When I try to follow the instructions, I get:
fpcmake -r
Processing Makefile.fpc
Error: Target "win32", package "rtl" not found

I have fpcdir=j:\Programming\fpc 3.0.2  set in my environment variables

Make -v  reports:
GNU Make 3.82
Built for i686-pc-mingw32

James

-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
Nikolay Nikolov
Sent: Tuesday, May 23, 2017 2:07 PM
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] FPC Graphics options?



On 05/23/2017 08:28 PM, James Richters wrote:
> I have done the "download snapshot" but I just don't know what to do with it 
> now to properly integrate it into my compiler.
Follow the instructions in docs/INSTALL.txt to compile the package. Then add 
units\i386-win32 from the snapshot directory to the unit search path of your 
compiler.
>
> Here is what I have tried to do.
> First I moved everything from J:\Programming\FPC 
> 3.0.2\units\i386-win32\graph to a temporary location so it wouldn't 
> find the old versions of ptcgraph and ptccrt Now when I try to compile 
> my program, I get unit ptcgraph not found... which is what I want because I 
> want to be sure not to get the old version Then I copied the entire snapshot 
> to into J:\Programming\FPC 3.0.2\units\i386-win32\ptcpas Now when I try to 
> compile my program, I still get unit ptcgraph not found.
> I added J:\Programming\FPC 3.0.2\units\$fpctarget\ptcpas\* to the 
> directories Now I got an error that it could not find graphh.inc So I 
> copied all the .inc files from J:\Programming\FPC 
> 3.0.2\units\i386-win32\graph\inc to J:\Programming\FPC 
> 3.0.2\units\i386-win32\graph because I have no idea how else to make it find 
> them.
> Now I can can compile successfully and run my program, but it has the same 
> issues.
> But I notice the modified file win32kbd.inc is never used.   I have even 
> removed it temporarily and I can still compile successfully.  I did a 
> search for win32kbd and I find win32kbdd.inc but not win32kbd.inc
>
> That is where I am at.  I think If I could correctly apply 
> win32kbd.inc it may work
>
> James
>
>
>
> -Original Message-
> From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On 
> Behalf Of Nikolay Nikolov
> Sent: Tuesday, May 23, 2017 1:03 PM
> To: fpc-pascal@lists.freepascal.org
> Subject: Re: [fpc-pascal] FPC Graphics options?
>
>
>
> On 05/23/2017 06:09 PM, James Richters wrote:
>> I think I figured out my problem, but I'm not sure how to fix it.   I was 
>> looking at the code here: https://sourceforge.net/p/ptcpas/code/714/
>> And I see that the change made was to win32kbd.inc, but I don't think I'm 
>> using the updated version of it.   I think my problem is that I just 
>> compiled ptcgraph.pp and replaced ptcgraph.ppu in 
>> FPCWin\units\i386-win32\graph so apparently that's not the correct way 
>> to do it.So then I tried adding the entire folder downloaded from 
>> https://sourceforge.net/projects/ptcpas/files/
> But that's a fix, that's not yet released (because it needs testing), so it's 
> in svn trunk only, and not in the release files. Get it from:
>
>https://sourceforge.net/p/ptcpas/code/HEAD/tree/trunk/
>
> Either click on "Download Snapshot", or install subversion 
> (TortoiseSVN) and checkout https://svn.code.sf.net/p/ptcpas/code/trunk
>
>> Into a folder at FPCWin\units\i386-win32\ptcpas  then renaming the original 
>> ptccrt.ppu and ptcgraph.ppu located in FPCWin\units\i386-win32\graph but now 
>> It can't find ptcgraph, even though it's there under  
>> FPCWin\units\i386-win32\ptcpas\ptcgraph so now I'm realizing that I'm just 
>> guessing and really don't have a clue the proper way to integrate this into 
>> my fpc compiler.
>>
>> Could someone please tell me the correct way I should be doing this so that 
>> the compiler will find the correct versions of all the files necessary?
>>
>> James
>>
>>
>> -Original Message-
>> From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On 
>> Behalf Of James Richters
>> Sent: Monday, May 22, 2017 7:13 PM
>> To: 'FPC-Pascal users discussions' 
>> Subject: Re: [fpc-pascal] FPC Graphics options?
>>
>>> Here is a simple sample program that has the issue for me on both my 
>>> windows 10 desktop and my windows 10 laptop, both are 64bit.
>>> https://hastebin.com/nubonozaho.pas
>> I started thinking about this, and did some more tests, and I think I have 
>> narrowed down what is really happening, but not sure how to fix it.
>>
>> The problem is not the ALT-tab from the graphics window,  it's ALT being 
>> pressed when the window focus changes.   CTRL is also affected, but not 
>> shift.  Try this:
>> Go to Graph window,  type some letters,  see that it's working correctly,  
>> now hold 

Re: [fpc-pascal] Browser and exe

2017-05-23 Thread noreply

On 2017-05-22 21:53, Marcos Douglas B. Santos wrote:

Hi,

If you have some apps or components which was written in Object Pascal
and you would like to use them in Web applications (client-side,
previously installed) what is the best option to choose nowadays?

My users use Windows so, I thought in ActiveX. It works, but I think
Chrome do not use anymore, right?

Is there a way to call an Exe (previously installed, no problem with
that) to interact with an Exe, working in IE and Chrome?



Exe is a security hazard that could barf up a person's hard drive 
instantly or create viruses..


ActiveX is indeed the closest thing to it, as it is like a program that 
is run from the browser, but in some kind of sandbox that does not allow 
it to do too much damage, although someone probably found a security 
issue with it and wrote a virus maybe years ago..

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] [FPC-Pascal] FPC Graphics options?

2017-05-23 Thread James Richters
*correction  to directory names:
Now I got an error that it could not find graphh.inc So I copied all the .inc 
files from J:\Programming\FPC 3.0.2\units\i386-win32\ptcpas\ptcgraph\inc  to 
J:\Programming\FPC 3.0.2\units\i386-win32\ptcpas\ptcgraph because I have no 
idea how else to make it find them.

-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
James Richters
Sent: Tuesday, May 23, 2017 1:29 PM
To: 'FPC-Pascal users discussions' 
Subject: Re: [fpc-pascal] FPC Graphics options?

I have done the "download snapshot" but I just don't know what to do with it 
now to properly integrate it into my compiler.  

Here is what I have tried to do.
First I moved everything from J:\Programming\FPC 3.0.2\units\i386-win32\graph 
to a temporary location so it wouldn't find the old versions of ptcgraph and 
ptccrt Now when I try to compile my program, I get unit ptcgraph not found... 
which is what I want because I want to be sure not to get the old version Then 
I copied the entire snapshot to into J:\Programming\FPC 
3.0.2\units\i386-win32\ptcpas Now when I try to compile my program, I still get 
unit ptcgraph not found.
I added J:\Programming\FPC 3.0.2\units\$fpctarget\ptcpas\* to the directories 
Now I got an error that it could not find graphh.inc So I copied all the .inc 
files from J:\Programming\FPC 3.0.2\units\i386-win32\graph\inc to 
J:\Programming\FPC 3.0.2\units\i386-win32\graph because I have no idea how else 
to make it find them.
Now I can can compile successfully and run my program, but it has the same 
issues.
But I notice the modified file win32kbd.inc is never used.   I have even 
removed it temporarily and I can still compile successfully.  I did a 
search for win32kbd and I find win32kbdd.inc but not win32kbd.inc

That is where I am at.  I think If I could correctly apply win32kbd.inc it may 
work

James



-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
Nikolay Nikolov
Sent: Tuesday, May 23, 2017 1:03 PM
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] FPC Graphics options?



On 05/23/2017 06:09 PM, James Richters wrote:
> I think I figured out my problem, but I'm not sure how to fix it.   I was 
> looking at the code here: https://sourceforge.net/p/ptcpas/code/714/
> And I see that the change made was to win32kbd.inc, but I don't think I'm 
> using the updated version of it.   I think my problem is that I just compiled 
> ptcgraph.pp and replaced ptcgraph.ppu in FPCWin\units\i386-win32\graph so 
> apparently that's not the correct way to do it.So then I tried adding the 
> entire folder downloaded from https://sourceforge.net/projects/ptcpas/files/
But that's a fix, that's not yet released (because it needs testing), so it's 
in svn trunk only, and not in the release files. Get it from:

  https://sourceforge.net/p/ptcpas/code/HEAD/tree/trunk/

Either click on "Download Snapshot", or install subversion (TortoiseSVN) and 
checkout https://svn.code.sf.net/p/ptcpas/code/trunk

> Into a folder at FPCWin\units\i386-win32\ptcpas  then renaming the original 
> ptccrt.ppu and ptcgraph.ppu located in FPCWin\units\i386-win32\graph but now 
> It can't find ptcgraph, even though it's there under  
> FPCWin\units\i386-win32\ptcpas\ptcgraph so now I'm realizing that I'm just 
> guessing and really don't have a clue the proper way to integrate this into 
> my fpc compiler.
>
> Could someone please tell me the correct way I should be doing this so that 
> the compiler will find the correct versions of all the files necessary?
>
> James
>
>
> -Original Message-
> From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On 
> Behalf Of James Richters
> Sent: Monday, May 22, 2017 7:13 PM
> To: 'FPC-Pascal users discussions' 
> Subject: Re: [fpc-pascal] FPC Graphics options?
>
>> Here is a simple sample program that has the issue for me on both my windows 
>> 10 desktop and my windows 10 laptop, both are 64bit.
>> https://hastebin.com/nubonozaho.pas
> I started thinking about this, and did some more tests, and I think I have 
> narrowed down what is really happening, but not sure how to fix it.
>
> The problem is not the ALT-tab from the graphics window,  it's ALT being 
> pressed when the window focus changes.   CTRL is also affected, but not 
> shift.  Try this:
> Go to Graph window,  type some letters,  see that it's working correctly,  
> now hold just ALT, or CTRL - switch to another window by clicking on it.  
> Click on console window, see letters are working correctly, now go back to 
> graph window,  anything you press acts like ALT, or CTRL is still being 
> pressed until you actually enter a keystroke using ALT, or CTRL.   It seems 
> to me there is probably some flag or variable being set that the alt or ctrl 
> key is being pressed, but is being interrupted by the window focus 

Re: [fpc-pascal] FPC Graphics options?

2017-05-23 Thread Florian Klämpfl
Am 23.05.2017 um 05:15 schrieb Ryan Joseph:
> and compiling with -O2 -Cfsse3 (the non-SDL

If you do benchmarking, at least -O3 should be used, -O4 is also fine most of 
the time.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC Graphics options?

2017-05-23 Thread Nikolay Nikolov



On 05/23/2017 11:05 PM, James Richters wrote:

Follow the instructions in docs/INSTALL.txt to compile the package. Then add 
units\i386-win32 from the snapshot directory to the unit search path of your 
compiler.

When I try to follow the instructions, I get:
fpcmake -r
Processing Makefile.fpc
Error: Target "win32", package "rtl" not found

I have fpcdir=j:\Programming\fpc 3.0.2  set in my environment variables
I'd recommend reinstalling FPC in a directory without spaces. Spaces in 
paths can cause trouble for fpcmake and makefiles in general. By default 
FPC installs in a directory without spaces, so it's not well tested at all.


Make -v  reports:
GNU Make 3.82
Built for i686-pc-mingw32

James

-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
Nikolay Nikolov
Sent: Tuesday, May 23, 2017 2:07 PM
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] FPC Graphics options?



On 05/23/2017 08:28 PM, James Richters wrote:

I have done the "download snapshot" but I just don't know what to do with it 
now to properly integrate it into my compiler.

Follow the instructions in docs/INSTALL.txt to compile the package. Then add 
units\i386-win32 from the snapshot directory to the unit search path of your 
compiler.

Here is what I have tried to do.
First I moved everything from J:\Programming\FPC
3.0.2\units\i386-win32\graph to a temporary location so it wouldn't
find the old versions of ptcgraph and ptccrt Now when I try to compile
my program, I get unit ptcgraph not found... which is what I want because I 
want to be sure not to get the old version Then I copied the entire snapshot to 
into J:\Programming\FPC 3.0.2\units\i386-win32\ptcpas Now when I try to compile 
my program, I still get unit ptcgraph not found.
I added J:\Programming\FPC 3.0.2\units\$fpctarget\ptcpas\* to the
directories Now I got an error that it could not find graphh.inc So I
copied all the .inc files from J:\Programming\FPC 
3.0.2\units\i386-win32\graph\inc to J:\Programming\FPC 
3.0.2\units\i386-win32\graph because I have no idea how else to make it find 
them.
Now I can can compile successfully and run my program, but it has the same 
issues.
But I notice the modified file win32kbd.inc is never used.   I have even 
removed it temporarily and I can still compile successfully.  I did a 
search for win32kbd and I find win32kbdd.inc but not win32kbd.inc

That is where I am at.  I think If I could correctly apply
win32kbd.inc it may work

James



-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On
Behalf Of Nikolay Nikolov
Sent: Tuesday, May 23, 2017 1:03 PM
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] FPC Graphics options?



On 05/23/2017 06:09 PM, James Richters wrote:

I think I figured out my problem, but I'm not sure how to fix it.   I was 
looking at the code here: https://sourceforge.net/p/ptcpas/code/714/
And I see that the change made was to win32kbd.inc, but I don't think I'm using 
the updated version of it.   I think my problem is that I just compiled 
ptcgraph.pp and replaced ptcgraph.ppu in FPCWin\units\i386-win32\graph so 
apparently that's not the correct way to do it.So then I tried adding the 
entire folder downloaded from https://sourceforge.net/projects/ptcpas/files/

But that's a fix, that's not yet released (because it needs testing), so it's 
in svn trunk only, and not in the release files. Get it from:

https://sourceforge.net/p/ptcpas/code/HEAD/tree/trunk/

Either click on "Download Snapshot", or install subversion
(TortoiseSVN) and checkout https://svn.code.sf.net/p/ptcpas/code/trunk


Into a folder at FPCWin\units\i386-win32\ptcpas  then renaming the original 
ptccrt.ppu and ptcgraph.ppu located in FPCWin\units\i386-win32\graph but now It 
can't find ptcgraph, even though it's there under  
FPCWin\units\i386-win32\ptcpas\ptcgraph so now I'm realizing that I'm just 
guessing and really don't have a clue the proper way to integrate this into my 
fpc compiler.

Could someone please tell me the correct way I should be doing this so that the 
compiler will find the correct versions of all the files necessary?

James


-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On
Behalf Of James Richters
Sent: Monday, May 22, 2017 7:13 PM
To: 'FPC-Pascal users discussions' 
Subject: Re: [fpc-pascal] FPC Graphics options?


Here is a simple sample program that has the issue for me on both my windows 10 
desktop and my windows 10 laptop, both are 64bit.
https://hastebin.com/nubonozaho.pas

I started thinking about this, and did some more tests, and I think I have 
narrowed down what is really happening, but not sure how to fix it.

The problem is not the ALT-tab from the graphics window,  it's ALT being 
pressed when the window focus changes.   CTRL is also affected, but not shift.  
Try this:
Go to Graph 

Re: [fpc-pascal] FPC Graphics options?

2017-05-23 Thread James Richters
>Just like you now use -FuSomePath to tell the compiler where to find units, 
>you can use -FiSomePath to tell the compiler where to look for include files.

I've been trying to compile with Free Pascal Text IDE, I have no experience 
with compiling programs from the command line,  but this gave me an idea to try 
it from command line instead.

First, I thought I would start clean, and  I re-installed Free Pascal and left 
the directory structure alone, and just changed the drive to H: where I have a 
lot of room. I suspect it did not like the space I had in my directory name.
From the new install of FPC 3.0.2 on my H Drive, I was able to successfully 
follow the instructions and I finally managed to compile ptcpas-code-715-trunk.

I was also able to compile the examples and they executed correctly.  So I used 
the command line used to compile one of the examples, and put the whole path of 
ptcpas in and I was finally able to successfully compile my test program with 
the following command line:
h:/FPC/3.0.2/bin/i386-Win32/ppc386.exe 
-Fuh:/ptcpas-code-715-trunk/units/i386-win32/ -FE. 
-FUh:/ptcpas-code-715-trunk/units/i386-win32 -di386 dual-key-screen.pas
When I compiled It this way, I am now able to ALT-Tab from the graph window and 
when I return everything is fine,  so this proves the problem has been solved, 
but integrating the solution into my compiler is the problem.

I am trying to get it to work from the Free Pascal text mode IDE
but when I add h:\ptcpas-code-715-trunk\units\i386-win32 to the list of unit 
directories in the Free Pascal text IDE and try to compile my program, I get:

PPU Loading H:\ptcpas-code-715-trunk\units\i386-win32\ptcgraph.ppu 
║ PPU Source: ptcgraph.pp not found
║ PPU Source: graphh.inc not available
║ PPU Source: graph.inc not available
║ PPU Source: fontdata.inc not available
║ PPU Source: clip.inc not available
║ PPU Source: palette.inc not available
║ PPU Source: modes.inc not available
║ PPU Source: fills.inc not available
║ PPU Source: gtext.inc not available
║ Recompiling ptcgraph, checksum changed for ptc
║ dual-key-screen.pas(3,6) Fatal: Can't find unit ptcgraph used by KeyTestWin.p
║ dual-key-screen.pas(0) Fatal: Compilation aborted

How do I properly use the FreePascal Text mode IDE to use the ptcpas units I 
compiled?

My entries under directories > Units are:
H:\ptcpas-code-715-trunk\units\i386-win32
h:\FPC\3.0.2\units\$fpctarget
h:\FPC\3.0.2\units\$fpctarget\*
h:\FPC\3.0.2\units\$fpctarget\rtl

All other directories tabs are blank

Thanks for the help

James

-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
Ewald
Sent: Tuesday, May 23, 2017 2:03 PM
To: FPC-Pascal users discussions 
Subject: Re: [fpc-pascal] [FPC-Pascal] FPC Graphics options?

On 23/05/17 19:50, James Richters wrote:
> *correction  to directory names:
> Now I got an error that it could not find graphh.inc So I copied all the .inc 
> files from J:\Programming\FPC 3.0.2\units\i386-win32\ptcpas\ptcgraph\inc  to 
> J:\Programming\FPC 3.0.2\units\i386-win32\ptcpas\ptcgraph because I have no 
> idea how else to make it find them.

Just like you now use -FuSomePath to tell the compiler where to find units, you 
can use -FiSomePath to tell the compiler where to look for include files.

See `fpc -h`, under the section "-F Set file names and paths:" for a list of 
other related switches.


--
Ewald
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org 
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Browser and exe

2017-05-23 Thread noreply

On 2017-05-23 20:52, Marcos Douglas B. Santos wrote:

On Tue, May 23, 2017 at 9:29 PM,   wrote:
Exe is a security hazard that could barf up a person's hard drive 
instantly

or create viruses..


I understand these security reasons and I agree, of course...
But this Exe that I am talking about should be installed for all
machines that want use the system so, won't be a problem for security.



Well there is always XUL Runner (Firefox embedded) or Chromium Embedded, 
to run a local browser on the computer machine that is just like 
chrome/firefox, but can communicate with real exe code.




I'm still thinking on these options:

1. NativeMessaging:
https://developer.chrome.com/extensions/nativeMessaging

2. to make an app that will be a local web server, after the user has 
installed.

The web real app could make requests to http//localhost and have a
communication between them.


Or a local chromium embedded/firefox embedded web browser that can talk 
to any native code you want, then the person does not need a web server 
running but will have to install the chromium embedded CEF dll's

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Browser and exe

2017-05-23 Thread Marcos Douglas B. Santos
On Tue, May 23, 2017 at 9:29 PM,   wrote:
> Exe is a security hazard that could barf up a person's hard drive instantly
> or create viruses..

I understand these security reasons and I agree, of course...
But this Exe that I am talking about should be installed for all
machines that want use the system so, won't be a problem for security.

> ActiveX is indeed the closest thing to it, as it is like a program that is
> run from the browser, but in some kind of sandbox that does not allow it to
> do too much damage, although someone probably found a security issue with it
> and wrote a virus maybe years ago..

Unfortunatelly I think either Chrome doesn't use it or there are some
restrictions... and they can cut off — if still working — in the
future, I don't know.
I would like to use something simpler, that doesn't depends of
Microsoft's stuff.

I'm still thinking on these options:

1. NativeMessaging:
https://developer.chrome.com/extensions/nativeMessaging

2. to make an app that will be a local web server, after the user has installed.
The web real app could make requests to http//localhost and have a
communication between them.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] OpenGL and SDL frustrations

2017-05-23 Thread Ryan Joseph
I’ve wasted so much time on this I just need to stop and ask for help already. 
Over the last few years I’ve been picking away at OpenGL and only ever got the 
legacy 2.x API to work which has been fine for making 2D games but I wanted to 
at least learn the modern API and shaders.

Here’s a snippet I cobbled together from a test program. It merely wants to 
draw a triangle. The actual OpenGL is from a tutorial and I don’t see how 
anything could be simpler than this. The only thing curious to me is why I 
can’t load the version of OpenGL I want from SDL. If I attempt to load 4.0 
(with SDL_GL_SetAttribute) GL_VERSION returns null but if I load 3.3 it works 
and GL_VERSION returns 4.1 anyways (I’m a Mac from 2015).

I removed the error handling code here but I don’t get any errors, just a black 
screen. Despite the tutorial I was following not using a shader they still got 
a white triangle (I added a shader also but it still didn’t work so I removed 
it to reduce complexity). The only thing I can think of is they were using GLEW 
and it did some init that SDL isn’t doing but I doubt it. This is barebones 
simple OpenGL here.

Any ideas on what’s wrong with this? I don’t care about this example in 
particular I just want to draw ANYTHING using OpenGL 3.3 so I can move forward.

=

type
TVec2 = record
x, y: GLfloat;
end;

var
verts: array[0..2] of TVec2;
bufferID: GLuint;   
vao: GLuint;

// run sdl window
if SDL_Init(SDL_INIT_VIDEO) < 0 then
Fatal('SDL could not initialize! '+SDL_GetError);

// load function pointers
if Load_GL_VERSION_3_3 = false then
Fatal('OpenGL is not loaded');

SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
// NOTE: 4.0 doesn't work, GL_VERSION return null
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);   
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);

// create window
window := SDL_CreateWindow('SDL Tutorial', SDL_WINDOWPOS_UNDEFINED, 
SDL_WINDOWPOS_UNDEFINED, width, height, SDL_WINDOW_SHOWN + SDL_WINDOW_OPENGL);
context := SDL_GL_CreateContext(window);
SDL_GL_MakeCurrent(window, context);
SDL_GL_SetSwapInterval(1);

writeln('Vendor: ', glGetString(GL_VENDOR));
writeln('OpenGL Version: ', glGetString(GL_VERSION));
writeln('GLSL Version: ', glGetString(GL_SHADING_LANGUAGE_VERSION));

// NOTE: despite SDL_GL_SetAttribute asking for 3.3 and 4.0 failing GL_VERSION 
still returns 4.1
// Vendor: Intel Inc.
// OpenGL Version: 4.1 INTEL-10.25.13
// GLSL Version: 4.10 

// setup
glViewPort(0, 0, width, height);

// simplest example possible
// https://www.youtube.com/watch?v=Dyue3MzJDss
verts[0].x := 0.0;
verts[0].y := 1.0; 
verts[1].x := -1.0;
verts[1].y := -1.0; 
verts[2].x := 1.0;
verts[2].y := -1.0;

// NOTE: glEnableVertexAttribArray returns an error if I don't bind a vao
glGenVertexArrays(1, @vao);
glBindVertexArray(vao);

// gen array buffer and bind to verts
glGenBuffers(1, @bufferID);
glBindBuffer(GL_ARRAY_BUFFER, bufferID);
glBufferData(GL_ARRAY_BUFFER, sizeof(verts), @verts, GL_STATIC_DRAW);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(TVec2), nil);

// draw loop
glClearColor(0, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT);
glDrawArrays(GL_TRIANGLES, 0, 3);
SDL_GL_SwapWindow(window);
...


Regards,
Ryan Joseph

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Browser and exe

2017-05-23 Thread leledumbo via fpc-pascal
> Is there a way to call an Exe (previously installed, no problem with that)
to interact with an Exe, working in IE and Chrome?

Not from client side AFAIK. You'll need to create a local server side app,
let that one executes the exe and response back to the client (if needed).



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Browser-and-exe-tp5728798p5728804.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal