Giter Club home page Giter Club logo

wxphp's Introduction

Build Status Download wxPHP Project Stats

Homepage | Documentation | Downloads | Applications | News | Chat


wxPHP Logo

wxPHP stands for "wxwidgets for PHP" and it is a php binding/wrapper for the cross-platform library wxWidgets, which gives you the ability to develop desktop applications using the php programming language. This applications can be executed on windows, linux and macosx using the same code base with a native look and feel.

One of the ideas is that you can use your php web applications code base and logic to create native desktop applications that communicate to them transparently. This way you can give your users a seamless and native experience from the desktop while staying in sync with your web apps.

There are many more use cases, but we invite you to download and try this project by your self. We hope everyone can enjoy it as much as we have enjoyed developing it.

wxFormBuilder

wxFormBuilder is a RAD tool for wxWidgets GUI design. So to make development with wxPHP more easier we added php support to it. For more information visit the project page.

Integration of PHP support wouldn't be possible without the help of RedTide and the rest of wxFormBuilder team, Thanks a lot!

Support

Any problems, please file an issue or visit the forums:

GitHub.com project page where development occurs:

SourceForge.net project page which hosts the binary builds.

Contributors & Sponsors

This project is possible thanks to the following people and all of those that report issues on the issue tracker. Thanks to Everyone!

Made with contributors-img.

PHP 7 and 8 upgrades have been sponsored by

wxphp's People

Contributors

chrisnharvey avatar gladox114 avatar halfer avatar jgmdev avatar lordoftherats avatar remicollet avatar toschug avatar weltling avatar yogarine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wxphp's Issues

wxGridRangeSelectEvent()

I am trying to select a row of a grid and have some of the cell values on that row copied into other windows.
I'm not sure that I'm doing it properly, but there seems to be some wrapper errors as well.

The event wxEVT_GRID_CMD_RANGE_SELECT seems to be the correct way, but the constant is not defined,
and wxEVT_GRID_RANGE_SELECT is defined.

wxGridRangeSelectEvent() initialises the topleft and bottomright wxGridCellCoords() to (-1, -1),
but the wxEVT_GRID_RANGE_SELECT event doesn't update them, so using topleft fails.

An upgrade of /wxphp/examples/grid.php would be useful.

Test source http://www.davekimble.org.au/wxphp/wxgrid.wxphp.txt

2 wxTimer()s ?

Ubuntu 13.04, wxWidgets v3, wxPHP 3-Jan-14
The app i'm developing has started doing "Segmentation fault (core dumped)" in places where it worked before.
The newest code changes brought in a second wxTimer(). Should this work OK?

I'm not sure a core dump will help me, but where is it located?

Memory leak 3

This one is slow so I have set the timer wait lower. It doesn't seem to be regular. (Platform: Ubuntu)

<?php
$frame = new wxFrame(null, wxID_TOP, "Title");
$timer = new wxTimer();
$timer->Connect(wxEVT_TIMER, array(wxID_TOP, "refresh"));
$timer->Start(10);
$frame->Show();
wxEntry();
function refresh()
{   global $frame;
    $host = rtrim(file_get_contents('/etc/hostname'));
    $frame->SetTitle("Host: $host");
}
?>

Status of this project

Hi,

I just wanted to say that I think this project is awesome and I hope it is still in development.

I am currently writing a PHP framework for desktop/CLI app development and I am building it primarily around wxphp.

I'm just interested to know the status of this project.

Thanks.

wxGrid::SetSelectionMode()

wxGrid::SetSelectionMode( wxGridSelectRows ) on windose (7) reports "undefined" constant wxGridSelectRows. Haven't tried it on any other platform, so not sure if this is a windose issue only.

wxRAISED_BORDER error

On Widose wxRAISED_BORDER generates the error below when created wxStaticText controls:

PHP Notice: Use of undefined constant wxRAISED_BORDER - assumed 'wxRAISED_BORDER'

Example code:
$label = new wxStaticText( $parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER );

Border styles are undefined

Border styles ( eg wxSIMPLE_BORDER, wxRAISED_BORDER etc ) still generate the following error on windose:

Fatal error: Undefined class constant 'wxRAISED_BORDER' in ....

memory leak

My script is leaking much faster than this example - it eats all memory in less than a day, but this is as simple as I can get it.

<?php
$frame = new wxFrame(null, wxID_TOP, "Title");
$timer = new wxTimer();
$timer->Connect(wxEVT_TIMER, array(wxID_TOP, "refresh"));
$timer->Start(1000);
$frame->Show();
wxEntry();
function OnInit() {}
function OnExit() {}
function refresh()
{   global $frame;
    $frame->SetTitle("Memory = ".memory_get_usage());
}
?>

Assets from phar archive

When building a phar archive, assets such as images do not seem to work when trying to instantiate an icon with an image from the phar:// context.

Is there something I'm missing or is this something that isn't supported yet?

wxMouseEvent::GetX/GetY/GetPosition

I have a wxFrame with ~wxCAPTION that holds a wxPanel.
I want to drag the wxPanel to move the whole wxFrame.
On wxEVT_LEFT_DOWN, $event->GetPosition() doesn't return as sensible result, nor on wxEVT_MOTION.

Beware: you definitely need all the code, or else CaptureMouse() without ReleaseMouse() will lock up the machine.

<?php
$framex = 0;
$framey = 0;
$startx = 0;
$starty = 0;
$frame = new wxFrame(null, wxID_TOP, "Title", wxDefaultPosition, wxDefaultSize, ~wxCAPTION );
$frame->Centre();
    $panel = new wxPanel($frame);
    $panel->Connect(wxEVT_LEFT_DOWN, array(wxID_TOP, "MouseDown"));
    $panel->Connect(wxEVT_MOTION, array(wxID_TOP, "MouseDrag"));
    $panel->Connect(wxEVT_LEFT_UP, array(wxID_TOP, "MouseUp"));
$frame->Show();
wxEntry();
function OnInit() {}
function OnExit() {}
//=======================================================
function MouseDown($event)
{   global $frame, $framex, $framey, $panel, $startx, $starty ;
    if(!$panel->HasCapture()) { $panel->CaptureMouse(); }
    $framex = $frame->GetPosition()->x;
    $framey = $frame->GetPosition()->y;
    $startx = $event->GetX();
    $starty = $event->GetY();
    //$startx = $event->GetPosition()->x;
    //$starty = $event->GetPosition()->y;
    echo("$framex,$framey $startx,$starty\n");
}
//=======================================================
function MouseDrag($event)
{   global $frame, $framex, $framey, $panel, $startx, $starty ;
    if($event->Dragging() )
    {   $x = $event->GetX();
        $y = $event->GetY();
        echo("$framex,$framey $startx,$starty $x,$y \n");
        $frame->SetPosition(new wxPoint($framex - $startx + $x, $framey - $starty + $y));
    } 
}
//=======================================================
function MouseUp($event)
{   global $panel ;
    if($panel->HasCapture() ) { $panel->ReleaseMouse(); }
}
?>

PECL

Just wondering if it would be possible to get wxPHP on PECL to make installing it even easier. Please correct me if it is already on PECL and I've missed it.

I really think this project has potential to be something huge in the PHP community and I think a listing on PECL will be a good step towards that.

Problem with reference counted objects

There is a problem with functions that return reference counted objects such as wxFont.

For example using the method GetFont in wxWindow:

$font = $this->GetFont();
var_dump($font->GetFaceName());

This will often lead to a seg fault because the underlying wxFont has been freed when $font->GetFaceName is called.

I've tried fixing PHP_METHOD(php_wxWindow, GetFont), and increasing the reference count of the returned value helps the problem:

wxFont value_to_return0;
value_to_return0 = ((wxWindow_php*)native_object)->GetFont();

((wxRefCounter *) value_to_return0.GetRefData())->IncRef();

void* ptr = safe_emalloc(1, sizeof(wxFont_php), 0);
memcpy(ptr, &value_to_return0, sizeof(wxFont));
object_init_ex(return_value, php_wxFont_entry);

I haven't yet looked into how to solve it in the code generator. Perhaps you have an idea of how to do it?

wxSound::Play()

wxSound produces no sound, although wxSound::IsOk returns true, the wxSound::Play() method produces no sound at all on Windose7.

memory leak 2

Drawing on wxClientDC - memory_get_usage() reports no leak, but KDE System Monitor does, so maybe this is not a wxPHP leak.
Additionally its curious that the white background extends beyond the boundaries of $panel to fill the client area of $frame

<?php
$values = array();
for($i=0; $i<199; $i++) { $values[$i] = $i; }
//
$frame = new wxFrame(null, wxID_TOP, "Title");
$panel = new wxPanel($frame, wxID_ANY, wxDefaultPosition, new wxSize(200, 200));
$timer = new wxTimer();
$timer->Connect(wxEVT_TIMER, array(wxID_TOP, "refresh"));
$timer->Start(100);
$frame->Show();
wxEntry();
function refresh()
{   global $frame, $panel, $values;
    $chart = new wxClientDC($panel);
    $chart->SetDeviceOrigin(0, 199);
    $chart->SetAxisOrientation(true, true);
    $chart->SetBackground(new wxBrush(new wxColour(255, 255, 255)));
    $chart->Clear();
    $red = new wxColour(255, 0, 0);
    $chart->SetPen(new wxPen($red));
    // draw the array values
    for($col=0; $col<199; $col++)
    {   $chart->DrawLine(new wxPoint($col, 0), new wxPoint($col, $values[$col]) );
    }
        $frame->SetTitle("Memory = ".memory_get_usage());
}
?>

Get wxPoint as 2 integers

x(); // $x = $point->X(); // $x = $point->GetX(); // $x = $point->Get(x); $y = $point->y(); echo("$x $y\n"); ?>

dk@desktop:$ php test.php
PHP Fatal error: Call to undefined method wxPoint::x() in /home/dk/test.php on line 3
dk@desktop:
$ php test.php
PHP Fatal error: Call to undefined method wxPoint::X() in /home/dk/test.php on line 3
dk@desktop:$ php test.php
PHP Fatal error: Call to undefined method wxPoint::GetX() in /home/dk/test.php on line 3
dk@desktop:
$ php test.php
PHP Fatal error: Call to undefined method wxPoint::Get() in /home/dk/test.php on line 3
dk@desktop:~$

How should this be done?
Same for wxSize.

Segfault when adding wxTreeItemData to a tree

I've tried adding data to the nodes of a wxTreeCtrl, and it seems to work while the app is running but causes a seqfault on exit.

Here's a simple app to test it:

<?php

class MyApp extends wxApp
{
    public function OnExit()
    {
        return 0;
    }

    public function OnInit()
    {
        $this->mainFrame = new MainFrame();
        $this->mainFrame->Show();

        return 0;
    }

    private $mainFrame;
}

class MyTreeData extends wxTreeItemData
{
    public function __construct($data)
    {
        parent::__construct();

        $this->data = $data;
    }

    private $data;
}

class MainFrame extends wxFrame
{
    public function __construct()
    {
        parent::__construct(null, -1, "Tree item data test");

        $this->tree = new wxTreeCtrl($this);

        // This works:
        // $root = $this->tree->AddRoot("Parent", -1, -1);

        // This will cause a segfault on exit:
        $root = $this->tree->AddRoot("Parent", -1, -1, new MyTreeData("Test"));

        $this->tree->AppendItem($root, "Child");

        $this->tree->Connect(wxEVT_COMMAND_TREE_ITEM_EXPANDED,
            array($this, 'OnExpanded'));
    }

    public function OnExpanded($event)
    {
        $item = $event->GetItem();
        $data = $this->tree->GetItemData($item);

        var_dump($data);
    }

    private $tree;
}

$app = new MyApp();
wxApp::SetInstance($app);
wxEntry();

?>

Update Gnu/Linux Build Guide

In the v3.0.0.2 you need to compile the wxwidgets version >= 3.1 but the guide tells you to build the 3_0_0.
So you can build the v3.0.0.0 against the wxwidgets 3_0_0. Or rebuild wxwidgets so you can compile the v3.0.0.2.

Thanks.
Gonzalo.

OS X Mavericks

I have been trying to compile wxphp on OS X Mavericks for the past two days with no luck. Does anyone know of a solution?

Thanks.

Error with wxDirDialog contructor parameters

Hi,
I can't make "wxDirDialog" to work.

"wxFileDialog" is OK but with "wxDirDialog" I always get error:

"PHP Fatal error: Abstract class or wrong type/count of parameters passed to: wxDirDialog::__construct..."

This is code I use:

$dialog = new wxDirDialog(null,
"Select a folder",
"",
wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);

I get the same error even with empty constructor.

Thank you.

wxDC::SetAxisOrientation(bool, bool)

This script draws lines on a wxClientDC, based on values in an array.
The default orientation is left-to-right, top-to-bottom (true, false), and works OK.
Using the method to set (true, false) works OK too.
Now alter the script to try each of the other combinations, and they should be mirror-flips of that, but they are all wrong.

<?php
$width = 200;
$height = 100;
$values = array();
for($i=0; $i<$width; $i++) 
{   $values[] = $i; 
}
//
$frame = new wxFrame(null, wxID_TOP, "", wxDefaultPosition, new wxSize($width, $height), ~wxCAPTION );
$frame->Centre();
$panel = new wxPanel($frame, wxID_ANY, wxDefaultPosition, new wxSize($width, $height));
$timer = new wxTimer();
$timer->Connect(wxEVT_TIMER, array(wxID_TOP, "refresh"));
$timer->Start(1000);
$frame->Show();
wxEntry();
function OnInit() {}
function OnExit() {}
function refresh()
{   global $height, $panel, $values, $width ;
    $chart = new wxClientDC($panel);
    $chart->SetAxisOrientation(true, false); //left-to-right, top-down
    //$chart->SetAxisOrientation(true, true); //left-to-right, bottom-up
    //$chart->SetAxisOrientation(false, true); //right-to-left, bottom-up
    //$chart->SetAxisOrientation(false, false); //right-to-left, top-down
    $chart->SetPen(new wxPen(new wxColour(255, 0, 0)));
    //
    for($col=0; $col< $width;$col++)
    {   $chart->DrawLine(new wxPoint($col, 0), new wxPoint($col, $values[$col] ) );
    }
}
?>

[updated to simplify]

README_MSW mistake

In the file is written:
Fix: On wxWidgets lib\vc_lib\mswu\wx\setup.h set:
wxUSE_POSTSCRIPT 1

but when we build wxWidgets that file will be overwrite and will not build postscript libraries.

set wxUSE_POSTSCRIPT 1 on file
include\wx\msw\setup.h

Virtual method calls cause segfaults on php 5.4 and up

Internal class virtual methods which call user space php methods are causing a segfault on the system. The code that follows is a sample of this:

<?php

class ButtonRenderer extends wxGridCellRenderer
{
    public function Draw(
        $grid, 
        $attr, 
        $dc,
        $rect, 
        $row, 
        $col, 
        $isSelected
    )
    {
        // fill the background
        $dc->SetBrush( new wxBrush(new wxColour(0xD3, 0xD3, 0xD3)) );
        $dc->DrawRectangle( $rect->GetX(), $rect->GetY(), $rect->GetWidth(), $rect->GetHeight());

        $strength = 1;

        $pen1 = new wxPen(new wxColour(255,255,255), $strength);

        $dc->SetPen($pen1);

        $dc->DrawLine(
            $rect->GetLeft()+$strength-1, 
            $rect->GetTop()+$strength-1,
            $rect->GetLeft()+$strength-1, 
            $rect->GetBottom()-$strength+1
        );

        $dc->DrawLine(
            $rect->GetLeft()+$strength-1, 
            $rect->GetTop()+$strength-1,
            $rect->GetRight()-$strength, 
            $rect->GetTop()+$strength-1
        );

        $pen2 = new wxPen(new wxColour(0,0,0), $strength);

        $dc->SetPen($pen2);

        $dc->DrawLine(
            $rect->GetRight()-$strength, 
            $rect->GetTop(),
            $rect->GetRight()-$strength, 
            $rect->GetBottom()
        );

        $dc->DrawLine(
            $rect->GetLeft(), 
            $rect->GetBottom(),
            $rect->GetRight() - $strength, 
            $rect->GetBottom()
        );

        // draw the button-label

        $dc->SetTextForeground( $attr->GetTextColour() );

        $dc->SetFont( $attr->GetFont() );

        $dc->DrawLabel( 
            "Delete", 
            $rect,
            wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL
        ); 
    }
}

class MyGrid extends wxGrid
{
    public function __construct( $parent )
    {
        parent::__construct($parent, wxID_ANY);

        $this->SetDefaultColSize(50);
        $this->SetDefaultRowSize(25);
        $this->SetRowLabelSize(50);
        $this->SetColLabelSize(25);
        $this->CreateGrid(5, 5, wxGrid::wxGridSelectCells);

        $attr = new wxGridCellAttr();
        $attr->SetReadOnly(true);
        $attr->SetRenderer(new ButtonRenderer());

        $this->SetColAttr(3, $attr);
    }
}

class MyApp extends wxApp
{
    public function OnExit()
    {
        return 0;
    }

    public function OnInit()
    {
        $this->frame = new MainFrame();
        $this->frame->Show();

        return 0;
    }
}

class MainFrame extends wxFrame
{
    public function __construct()
    {
        parent::__construct(null, -1, "wxGridCellRenderer Test");

        $this->grid = new MyGrid($this);
    }
}

$app = new MyApp();
wxApp::SetInstance($app);
wxEntry();

?>

on the previous code the method Draw on ButtonRenderer overrides/implements the default implementation of wxGridCellRenderer, but when wxGrid calls the method to draw the button inside the cell it fails causing a segfault.

Non pointer object parameters passed to methods not allowing child types

Discovered thanks to issue #34 that calls to methods like:

bool wxClipBoard::GetData ( wxDataObject &$data )

don't allow to use objects which inherit from the main parameter data type, in this case it would be wxDataObject, which serves as a base class for wxTextDataObject and some others. So doing something as follows would fail:

<?php
$clipboard->Open();
$clipboard->GetData($data);
wxMessageBox( $data->GetText() );
$clipboard->Close();

The example fails because zend_parse_parameters_ex is being used with "O" to enforce the class entry (type) as follows:

"O", &data, php_wxDataObject_entry

So to fix this is needed to change from "O" to "o" and check the object type separately to see if it matches the base object type or one of its child's.

How to DrawPoint ?

I am trying to draw a chart of some values in an array.
I have a frame holding a wxPanel window, holding a wxBufferedPaintDC object.
My commands $chart->SetBrush() and $chart->DrawPoint() don't get errored,
but nothing actually happens on screen.

Silly example:

<?php
$width = 180;
$height = 100;
$white = new wxBrush(new wxColour(255, 255, 255));
//
$frame = new wxFrame(null, wxID_TOP, "Title", wxDefaultPosition, new wxSize($width, $height), ~wxCAPTION );
$frame->Centre();
$panel = new wxPanel($frame, wxID_ANY, wxDefaultPosition, new wxSize($width, $height));
$chart = new wxBufferedPaintDC($panel);
$chart->SetBrush($white);
$timer = new wxTimer();
$timer->Connect(wxEVT_TIMER, array(wxID_TOP, "refresh"));
$timer->Start(1000);
$frame->Show();
wxEntry();
function OnInit() {}
function OnExit() {}
//
function refresh()
{   global $chart, $height, $white, $width ;
    for($row=0; $row<$height; $row++)
    {   for($col=0; $col<$width; $col++)
        {   $chart->DrawPoint($col, $row);
        }
    }
}
?>

JPEG files

The following code works OK:

$graph = new wxStaticBitmap( $this, wxID_ANY, new wxBitmap( "graph.bmp", wxBITMAP_TYPE_ANY ), wxDefaultPosition, new wxSize( 350, 255 ) );

However, if I try to use a JPG version of "graph.bmp", the application crashes ( graph.jpg does exist )

php cli crashed on wxThread create and run.

class Sound extends wxThread{
public function __construct($parent){
parent::__construct(wxTHREAD_JOINABLE);
$this->parent = $parent;
}

public function Entry(){
    print "Printed from thread\n";
}

}

$sound = new Sound($this); //$this object inherited from wxFrame
$sound->Create();
$sound->Run();

./configure fails on Mac

When I try to compile on Mac OS X (Mavericks, dit not test other versions) I get the following error when running ./configure:

$ ./configure
[...]
checking for webkitgtk include files... not found
configure: error: webkitgtk include files where not found

I'm having this issue from 3.0.0.1 forward. 3.0.0.0 compiles perfectly for me. Appears config.m4 in 3.0.0.1 has new additional checks for webkitgtk and a bunch of other libraries which are linux specific.
When I replace config.m4 with the one from 3.0.0.0 it builds perfectly.

Please don't forget us Mac OS developers, please people.

Dispense with PHP Warning

When an application exits normally, without any errors, the warning below is displayed:

//----- begin

PHP Warning: Object of class wxFrame went out of scope. Remember to always call Destroy() to prevent memory leaks. in Unknown on line 0

//----- end

Can we/should we get rid of it?

app.cpp seems buggy

Hello.

I am trying to compile wxPHP as an integrated module for easier distribution. The process itself and everything else works perfectly. BUT: This happens.


In file included from /Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:13:
ext/wxwidgets/php_wxwidgets.h:19:20: error: common.h: No such file or directory
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:14:17: error: app.h: No such file or directory
In file included from /Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:13:
ext/wxwidgets/php_wxwidgets.h:64: error: expected class-name before ‘{’ token
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp: In function ‘void php_wxApp_free(void*, void***)’:
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:29: error: ‘zo_wxApp’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:29: error: ‘custom_object’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:29: error: expected primary-expression before ‘)’ token
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:29: error: expected `;' before ‘object’
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp: In function ‘zend_object_value php_wxApp_new(zend_class_entry*, void***)’:
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:43: error: ‘zo_wxApp’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:43: error: ‘custom_object’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:44: error: expected primary-expression before ‘)’ token
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:44: error: expected `;' before ‘_emalloc’
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:58: error: ‘PHP_WXAPP_TYPE’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp: At global scope:
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:68: error: ‘wxAppWrapper’ has not been declared
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp: In function ‘int OnExit()’:
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:75: error: ‘phpObj’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:75: error: ‘tsrm_ls’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:77: error: ‘_T’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:77: error: ‘wxMessageBox’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp: At global scope:
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:82: error: ‘wxAppWrapper’ has not been declared
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp: In function ‘bool OnInit()’:
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:89: error: ‘wxFileSystem’ has not been declared
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:89: error: expected type-specifier before ‘wxZipFSHandler’
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:89: error: expected `)' before ‘wxZipFSHandler’
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:91: error: ‘phpObj’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:91: error: ‘tsrm_ls’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:93: error: ‘_T’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:93: error: ‘wxMessageBox’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp: At global scope:
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:100: error: expected constructor, destructor, or type conversion before ‘(’ token
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp: In function ‘void zim_php_wxApp___construct(int, zval*, zval**, zval*, int, void***)’:
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:107: error: ‘zo_wxApp’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:107: error: ‘current_object’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:109: error: ‘wxAppWrapper’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:109: error: ‘native_object’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:109: error: expected type-specifier before ‘wxAppWrapper’
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:109: error: expected `;' before ‘wxAppWrapper’
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:116: error: expected primary-expression before ‘)’ token
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:116: error: expected `;' before ‘zend_object_store_get_object’
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp: In function ‘void zim_php_wxApp_SetInstance(int, zval*, zval**, zval*, int, void***)’:
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:130: error: ‘php_wxApp_entry’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:135: error: ‘wxApp’ has not been declared
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:135: error: ‘wxAppWrapper’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:135: error: expected primary-expression before ‘)’ token
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:135: error: ‘zo_wxApp’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:135: error: expected primary-expression before ‘)’ token
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp: In function ‘void zim_php_wxApp_Yield(int, zval*, zval**, zval*, int, void***)’:
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:154: error: ‘wxAppWrapper’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:154: error: ‘native_object’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:154: error: ‘zo_wxApp’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:154: error: expected primary-expression before ‘)’ token
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:154: error: expected `)' before ‘zend_object_store_get_object’
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:159: error: ‘wxApp’ was not declared in this scope
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:159: error: expected primary-expression before ‘)’ token
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:159: error: expected `)' before ‘native_object’
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:159: error: expected `)' before ‘;’ token
/Users/Ingwie/Downloads/php-5.5.3/ext/wxwidgets/src/app.cpp:159: error: expected `)' before ‘;’ token
make: *** [ext/wxwidgets/src/app.lo] Error 1

Its basically the compiler saying: Bro, ur file's broken completeleh.

It however looks like as that common.h is a troubblemaker.

To reproduce: Download the drag0n-php repo from my github
Go into it and execute:

./configure \
    --prefix=/Applications/drag0n/drag0n.app/Contents/System \
    --enable-embed=static \
    --enable-static=yes \
    --with-config-file-path="" \
    --with-config-file-scan-dir="" \
    --enable-maintainer-zts \
    --enable-pthreads \
    --with-wxwidgets \
    --enable-wxwidgets-monolithic \
    --enable-mbstring \
    --enable-ftp \
    --enable-soap \
    --enable-zip \
    --enable-opcache \
    --with-tidy \
    --with-libedit \
    --with-curl \
    --with-mcrypt \
    --with-gd \
    --with-pear \
    --with-libedit \
    --with-curl \
    --enable-intl \
    --enable-soap \
    --enable-libxml && make

Then just wait a while... Make sure you have the needed libs installed. (automake, autoconf, bison, libcurl, mcrypt, pth, icu, GD). change -libedit to -readline if needed. You can ommit it too.

My repo: https://github.com/ingwiePhoenix/drag0n-php

Would be great to have this fixed :)

Build error against wxwidget 3.0.0

Build of ctrl.cpp fails with

/work/GIT/wxphp/src/ctrl.cpp:16188:40: error: 'class wxComboCtrl_php' has no member named 'SetTextIndent'
((wxComboCtrl_php_)native_object)->SetTextIndent((int) indent0);
^
/work/GIT/wxphp/src/ctrl.cpp:18993:90: error: 'class wxComboCtrl_php' has no member named 'GetTextIndent'
ZVAL_LONG(return_value, ((wxComboCtrl_php_)native_object)->GetTextIndent());
^

constant wxBORDER_SUNKEN

At http://docs.wxwidgets.org/trunk/classwx_window.html it describes wxBORDER_SUNKEN and wxSUNKEN_BORDER (deprecated) for wxWindow items, eg wxTextCtrl().
wxPHP defines wxBORDER_SUNKEN, but it doesn't seem to implement it.
Likewise wxBORDER_RAISED.

wxBORDER_NONE works OK and the default is wxBORDER_SIMPLE OK.

Platform: Ubuntu
Would the window manager used make a difference here?
I think wxBORDER_SUNKEN worked on MSW.

wxClipboard()

Once again I don't really know what I'm doing, but I can't see how the app can be responsible for this:

Platform: Ubuntu 13.04 [32] - X11

<?php
$clipboard = new wxClipboard();
$clipboard->UsePrimarySelection(false); // redundant
wxEntry();
function OnInit() 
{   getcopy(1);
    getcopy(2);
    getcopy(3);
}
function getcopy($i) {
global $clipboard ;
$text = "some string";
if(!$clipboard->Open()) { echo("Cannot open clipboard\n"); }
echo("$i: a\n");
$clipboard->SetData(new wxTextDataObject($text));
echo("$i: b\n");
$clipboard->Close();
}
?>

First time through, no errors but paste to another app produces nothing.
Second time through function: "An assertion failed!"
../src/gtk/clipbrd.cpp(91): assert "clipboard == ms_clipboard" failed in OnDone(): got notification for alien clipboard
Continue seems to let it carry on OK.
Pasting to another app causes a moment's pause, but nothing appears.

Windows build failed

Compilation error. (vc11 x86, php-5.5.7, wxwidgets-3)

app.cpp
ext\wxphp\src\app.cpp(26) : error C4430: missing type specifier - int assumed. N
ote: C++ does not support default-int
ext\wxphp\src\app.cpp(26) : error C2556: 'int wxDisableAsserts(void)' : overload
ed function differs only by return type from 'void wxDisableAsserts(void)'
d:\Sektor\Develop\Cpp_Libs\wxWidgets-3.0.0_vc11_x64\include\wx/debug.h(
145) : see declaration of 'wxDisableAsserts'
ext\wxphp\src\app.cpp(26) : error C2371: 'wxDisableAsserts' : redefinition; diff
erent basic types
d:\Sektor\Develop\Cpp_Libs\wxWidgets-3.0.0_vc11_x64\include\wx/debug.h(
145) : see declaration of 'wxDisableAsserts'
ext\wxphp\src\app.cpp(26) : error C2761: 'void wxLog::SetLogLevel(wxLogLevel)' :
member function redeclaration not allowed
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\amd64\cl.exe"' : return code '0x2'
Stop.

constant wxEVT_TEXT_ENTER

The constant wxEVT_TEXT_ENTER is not defined, and is not listed in http://wxphp.org/reference/constants.html .
It requires wxTextCtrl() to have style wxTE_PROCESS_ENTER set to generate the event, and that is defined.

Connect(wxEVT_TEXT_ENTER, array(wxID_TOP, "OK_clicked") ); ?>

PHP Notice: Use of undefined constant wxEVT_TEXT_ENTER - assumed 'wxEVT_TEXT_ENTER' in ...
PHP Fatal error: Incorrect type of parameters in ...

zend_register_internal_class_ex to implement inheritance

Today I discovered:

ZEND_API zend_class_entry *zend_register_internal_class_ex(
  zend_class_entry *class_entry, 
  zend_class_entry *parent_ce, 
  char *parent_name 
  TSRMLS_DC
);

which can be used to implement inheritance from one zend class to another. This can be used for c++ classes which don't implement multiple inheritance.

Doing this reduces the module header files size which reduces compile time a little bit, strips some 2 extra megabytes from the final binary and decreases the ram consumption.

In order for this to correctly work, registered classes on the MINIT function gotta be in order of inheritance, where parent classes are registered first and then child ones. One way to easily determine if the generated order is correct would be by passing the parent_name (PHP_wxClass_name) to zend_register_internal_class_ex to see if compiler complains about parent_name not being declared.

This issue will serve as reference and reminder of this new change in the case it causes problems.

wxPasswordEntryDialog()

wxPasswordEntryDialog() doesn't seem to be working properly.

gives
password
and

gives
password1

It functions OK, but the height is clipped, and the constant is worse than using nothing.

Possible problem with fonts

A normally working application failes to shutdown in a clean manner when fonts are used/modified.

Example code:

  1. $label = new wxStaticText( $parent, wxID_ANY, "TEST", wxDefaultPosition, wxDefaultSize );
  2. $font = $label->GetFont();
  3. $font->MakeBold();
  4. $label->SetFont( $font );

Application works and shuts down OK without the lines 3 - 5, with those lines in windose complains that CLI did not properly close - in worst cases the commandline just hangs and the only way to stop the app is via Task Manager.

Error loading images in wxBitmap

Hi,
I have a problem with wxBitmap widget.

I create a wxStaticBitmap direved class this way:

parent::__construct($parent,
wxID_ANY,
new wxBitmap($src),
new wxPoint($x, $y),
new wxSize($width, $height),
0);

where $src is the full path to image file.

I can see images correctly but each time I get an error message

"Failed to load image from file ..."

Can you please help me?

Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.