Skip to content

Commit

Permalink
Added GtkSeparatorToolItem and some GtkWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
scorninpc committed May 28, 2019
1 parent b6bc4f9 commit 8d47c5c
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 2 deletions.
9 changes: 9 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,14 @@ extern "C"
gtktoolitem.method<&GtkToolItem_::get_text_size_group>("get_text_size_group");


// GtkSeparatorToolItem
Php::Class<GtkSeparatorToolItem_> gtkseparatortoolitem("GtkSeparatorToolItem");
gtkseparatortoolitem.extends(gtktoolitem);
gtkseparatortoolitem.method<&GtkSeparatorToolItem_::__construct>("__construct");
gtkseparatortoolitem.method<&GtkSeparatorToolItem_::set_draw>("set_draw");
gtkseparatortoolitem.method<&GtkSeparatorToolItem_::get_draw>("get_draw");


// GtkToolbar
Php::Class<GtkToolbar_> gtktoolbar("GtkToolbar");
gtktoolbar.extends(gtkcontainer);
Expand Down Expand Up @@ -1635,6 +1643,7 @@ extern "C"
extension.add(std::move(gtkreliefstyle));
extension.add(std::move(gtksizegroup));
extension.add(std::move(gtktoolitem));
extension.add(std::move(gtkseparatortoolitem));
extension.add(std::move(gtktoolbar));
extension.add(std::move(gtktoolbutton));
extension.add(std::move(gtktexttagtable));
Expand Down
1 change: 1 addition & 0 deletions main.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@

#include "src/GtkToolItem.h"
#include "src/GtkToolButton.h"
#include "src/GtkSeparatorToolItem.h"

#include "src/GtkTextTagTable.h"

Expand Down
34 changes: 34 additions & 0 deletions src/GtkSeparatorToolItem.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

#include "GtkSeparatorToolItem.h"

/**
* Constructor
*/
GtkSeparatorToolItem_::GtkSeparatorToolItem_() = default;

/**
* Destructor
*/
GtkSeparatorToolItem_::~GtkSeparatorToolItem_() = default;

void GtkSeparatorToolItem_::__construct()
{
instance = (gpointer *)gtk_separator_tool_item_new ();

}

void GtkSeparatorToolItem_::set_draw(Php::Parameters &parameters)
{
gboolean homogeneous = (gboolean)parameters[0];

gtk_separator_tool_item_set_draw (GTK_SEPARATOR_TOOL_ITEM(instance), homogeneous);

}

Php::Value GtkSeparatorToolItem_::get_draw()
{
gboolean ret = gtk_separator_tool_item_get_draw (GTK_SEPARATOR_TOOL_ITEM(instance));

return ret;
}

35 changes: 35 additions & 0 deletions src/GtkSeparatorToolItem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

#ifndef _PHPGTK_GTKSEPARATORTOOLITEM_H_
#define _PHPGTK_GTKSEPARATORTOOLITEM_H_

#include <phpcpp.h>
#include <gtk/gtk.h>

#include "GtkToolItem.h"

/**
* GtkSeparatorToolItem_
*
* https://developer.gnome.org/gtk3/stable/GtkSeparatorToolItem.html
*/
class GtkSeparatorToolItem_ : public GtkToolItem_
{
/**
* Publics
*/
public:

/**
* C++ constructor and destructor
*/
GtkSeparatorToolItem_();
~GtkSeparatorToolItem_();

void __construct();

void set_draw(Php::Parameters &parameters);

Php::Value get_draw();
};

#endif
4 changes: 2 additions & 2 deletions src/GtkWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ Php::Value GtkWindow_::get_position()

// Cria o retorno
Php::Value arr;
arr["x"] = x;
arr["y"] = y;
arr[0] = arr["x"] = x;
arr[1] = arr["y"] = y;

return arr;
}
Expand Down

0 comments on commit 8d47c5c

Please sign in to comment.