-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/scorninpc/php-gtk3-tests
- Loading branch information
Showing
10 changed files
with
357 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
|
||
#include "GtkAppChooserButton.h" | ||
|
||
/** | ||
* Constructor | ||
*/ | ||
GtkAppChooserButton_::GtkAppChooserButton_() = default; | ||
|
||
/** | ||
* Destructor | ||
*/ | ||
GtkAppChooserButton_::~GtkAppChooserButton_() = default; | ||
|
||
void GtkAppChooserButton_::__construct(Php::Parameters ¶meters) | ||
{ | ||
std::string s_content_type = parameters[0]; | ||
gchar *content_type = (gchar *)s_content_type.c_str(); | ||
|
||
instance = (gpointer *)gtk_app_chooser_button_new (content_type); | ||
} | ||
|
||
void GtkAppChooserButton_::append_custom_item(Php::Parameters ¶meters) | ||
{ | ||
// std::string s_name = parameters[0]; | ||
// gchar *name = (gchar *)s_name.c_str(); | ||
|
||
// std::string s_label = parameters[1]; | ||
// gchar *label = (gchar *)s_label.c_str(); | ||
|
||
|
||
// gtk_app_chooser_button_append_custom_item (GTK_APP_CHOOSER_BUTTON(instance), name, label, icon); | ||
|
||
throw Php::Exception("GtkAppChooserButton_::append_custom_item not implemented"); | ||
|
||
} | ||
|
||
void GtkAppChooserButton_::append_separator() | ||
{ | ||
gtk_app_chooser_button_append_separator (GTK_APP_CHOOSER_BUTTON(instance)); | ||
|
||
} | ||
|
||
void GtkAppChooserButton_::set_active_custom_item(Php::Parameters ¶meters) | ||
{ | ||
std::string s_name = parameters[0]; | ||
gchar *name = (gchar *)s_name.c_str(); | ||
|
||
gtk_app_chooser_button_set_active_custom_item (GTK_APP_CHOOSER_BUTTON(instance), name); | ||
|
||
} | ||
|
||
Php::Value GtkAppChooserButton_::get_show_default_item() | ||
{ | ||
gboolean ret = gtk_app_chooser_button_get_show_default_item (GTK_APP_CHOOSER_BUTTON(instance)); | ||
|
||
return ret; | ||
} | ||
|
||
void GtkAppChooserButton_::set_show_default_item(Php::Parameters ¶meters) | ||
{ | ||
gboolean setting = (gboolean)parameters[0]; | ||
|
||
gtk_app_chooser_button_set_show_default_item (GTK_APP_CHOOSER_BUTTON(instance), setting); | ||
|
||
} | ||
|
||
Php::Value GtkAppChooserButton_::get_show_dialog_item() | ||
{ | ||
gboolean ret = gtk_app_chooser_button_get_show_dialog_item (GTK_APP_CHOOSER_BUTTON(instance)); | ||
|
||
return ret; | ||
} | ||
|
||
void GtkAppChooserButton_::set_show_dialog_item(Php::Parameters ¶meters) | ||
{ | ||
gboolean setting = (gboolean)parameters[0]; | ||
|
||
gtk_app_chooser_button_set_show_dialog_item (GTK_APP_CHOOSER_BUTTON(instance), setting); | ||
|
||
} | ||
|
||
Php::Value GtkAppChooserButton_::get_heading() | ||
{ | ||
std::string ret = gtk_app_chooser_button_get_heading (GTK_APP_CHOOSER_BUTTON(instance)); | ||
|
||
return ret; | ||
} | ||
|
||
void GtkAppChooserButton_::set_heading(Php::Parameters ¶meters) | ||
{ | ||
std::string s_heading = parameters[0]; | ||
gchar *heading = (gchar *)s_heading.c_str(); | ||
|
||
gtk_app_chooser_button_set_heading (GTK_APP_CHOOSER_BUTTON(instance), heading); | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
#ifndef _PHPGTK_GTKAPPCHOOSERBUTTON_H_ | ||
#define _PHPGTK_GTKAPPCHOOSERBUTTON_H_ | ||
|
||
#include <phpcpp.h> | ||
#include <gtk/gtk.h> | ||
|
||
#include "GtkComboBox.h" | ||
|
||
/** | ||
* GtkAppChooserButton_ | ||
* | ||
* https://developer.gnome.org/gtk3/stable/GtkAppChooserButton.html | ||
*/ | ||
class GtkAppChooserButton_ : public GtkComboBox_ | ||
{ | ||
/** | ||
* Publics | ||
*/ | ||
public: | ||
|
||
/** | ||
* C++ constructor and destructor | ||
*/ | ||
GtkAppChooserButton_(); | ||
~GtkAppChooserButton_(); | ||
|
||
void __construct(Php::Parameters ¶meters); | ||
|
||
void append_custom_item(Php::Parameters ¶meters); | ||
|
||
void append_separator(); | ||
|
||
void set_active_custom_item(Php::Parameters ¶meters); | ||
|
||
Php::Value get_show_default_item(); | ||
|
||
void set_show_default_item(Php::Parameters ¶meters); | ||
|
||
Php::Value get_show_dialog_item(); | ||
|
||
void set_show_dialog_item(Php::Parameters ¶meters); | ||
|
||
Php::Value get_heading(); | ||
|
||
void set_heading(Php::Parameters ¶meters); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
|
||
#include "GtkComboBoxText.h" | ||
|
||
/** | ||
* Constructor | ||
*/ | ||
GtkComboBoxText_::GtkComboBoxText_() = default; | ||
|
||
/** | ||
* Destructor | ||
*/ | ||
GtkComboBoxText_::~GtkComboBoxText_() = default; | ||
|
||
void GtkComboBoxText_::__construct() | ||
{ | ||
instance = (gpointer *)gtk_combo_box_text_new (); | ||
|
||
} | ||
|
||
Php::Value GtkComboBoxText_::new_with_entry() | ||
{ | ||
GtkWidget *ret = gtk_combo_box_text_new_with_entry (); | ||
|
||
GtkComboBoxText_ *return_parsed = new GtkComboBoxText_(); | ||
return_parsed->set_instance((gpointer *)ret); | ||
return Php::Object("GtkComboBoxText", return_parsed); | ||
} | ||
|
||
void GtkComboBoxText_::append(Php::Parameters ¶meters) | ||
{ | ||
std::string s_id = parameters[0]; | ||
gchar *id = (gchar *)s_id.c_str(); | ||
|
||
std::string s_text = parameters[1]; | ||
gchar *text = (gchar *)s_text.c_str(); | ||
|
||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT(instance), id, text); | ||
|
||
} | ||
|
||
void GtkComboBoxText_::prepend(Php::Parameters ¶meters) | ||
{ | ||
std::string s_id = parameters[0]; | ||
gchar *id = (gchar *)s_id.c_str(); | ||
|
||
std::string s_text = parameters[1]; | ||
gchar *text = (gchar *)s_text.c_str(); | ||
|
||
gtk_combo_box_text_prepend (GTK_COMBO_BOX_TEXT(instance), id, text); | ||
|
||
} | ||
|
||
void GtkComboBoxText_::insert(Php::Parameters ¶meters) | ||
{ | ||
gint position = (gint)parameters[0]; | ||
|
||
std::string s_id = parameters[1]; | ||
gchar *id = (gchar *)s_id.c_str(); | ||
|
||
std::string s_text = parameters[2]; | ||
gchar *text = (gchar *)s_text.c_str(); | ||
|
||
gtk_combo_box_text_insert (GTK_COMBO_BOX_TEXT(instance), position, id, text); | ||
|
||
} | ||
|
||
void GtkComboBoxText_::append_text(Php::Parameters ¶meters) | ||
{ | ||
std::string s_text = parameters[0]; | ||
gchar *text = (gchar *)s_text.c_str(); | ||
|
||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(instance), text); | ||
|
||
} | ||
|
||
void GtkComboBoxText_::prepend_text(Php::Parameters ¶meters) | ||
{ | ||
std::string s_text = parameters[0]; | ||
gchar *text = (gchar *)s_text.c_str(); | ||
|
||
gtk_combo_box_text_prepend_text (GTK_COMBO_BOX_TEXT(instance), text); | ||
|
||
} | ||
|
||
void GtkComboBoxText_::insert_text(Php::Parameters ¶meters) | ||
{ | ||
gint position = (gint)parameters[0]; | ||
|
||
std::string s_text = parameters[1]; | ||
gchar *text = (gchar *)s_text.c_str(); | ||
|
||
gtk_combo_box_text_insert_text (GTK_COMBO_BOX_TEXT(instance), position, text); | ||
|
||
} | ||
|
||
void GtkComboBoxText_::remove(Php::Parameters ¶meters) | ||
{ | ||
gint position = (gint)parameters[0]; | ||
|
||
gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT(instance), position); | ||
|
||
} | ||
|
||
void GtkComboBoxText_::remove_all() | ||
{ | ||
gtk_combo_box_text_remove_all (GTK_COMBO_BOX_TEXT(instance)); | ||
|
||
} | ||
|
||
Php::Value GtkComboBoxText_::get_active_text() | ||
{ | ||
std::string ret = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT(instance)); | ||
|
||
return ret; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
#ifndef _PHPGTK_GTKCOMBOBOXTEXT_H_ | ||
#define _PHPGTK_GTKCOMBOBOXTEXT_H_ | ||
|
||
#include <phpcpp.h> | ||
#include <gtk/gtk.h> | ||
|
||
#include "GtkComboBox.h" | ||
#include "GtkWidget.h" | ||
|
||
/** | ||
* GtkComboBoxText_ | ||
* | ||
* https://developer.gnome.org/gtk3/stable/GtkComboBoxText.html | ||
*/ | ||
class GtkComboBoxText_ : public GtkComboBox_ | ||
{ | ||
/** | ||
* Publics | ||
*/ | ||
public: | ||
|
||
/** | ||
* C++ constructor and destructor | ||
*/ | ||
GtkComboBoxText_(); | ||
~GtkComboBoxText_(); | ||
|
||
void __construct(); | ||
|
||
static Php::Value new_with_entry(); | ||
|
||
void append(Php::Parameters ¶meters); | ||
|
||
void prepend(Php::Parameters ¶meters); | ||
|
||
void insert(Php::Parameters ¶meters); | ||
|
||
void append_text(Php::Parameters ¶meters); | ||
|
||
void prepend_text(Php::Parameters ¶meters); | ||
|
||
void insert_text(Php::Parameters ¶meters); | ||
|
||
void remove(Php::Parameters ¶meters); | ||
|
||
void remove_all(); | ||
|
||
Php::Value get_active_text(); | ||
}; | ||
|
||
#endif |
Oops, something went wrong.