[gtkmm] Entry: Add input purpose and input hints methods.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Entry: Add input purpose and input hints methods.
- Date: Wed, 29 Aug 2012 22:24:30 +0000 (UTC)
commit a373013867cceeb2544c60122ede35f82e7dca2d
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Aug 30 00:21:20 2012 +0200
Entry: Add input purpose and input hints methods.
* gtk/src/entry.hg: Added get/set_input_purpose() and
get/set_input_hints() and properties.
* gtk/src/gtk_enums.defs:
* gtk/src/gtk_methods.defs: Regenerate.
* tools/m4/convert_gtk.m4: Add necessary conversions.
ChangeLog | 10 ++
gtk/src/entry.hg | 10 ++
gtk/src/gtk_enums.defs | 116 +++++++++++++++++
gtk/src/gtk_methods.defs | 309 +++++++++++++++++++++++++++++++++++++++++++++-
tools/m4/convert_gtk.m4 | 2 +
5 files changed, 442 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 99908b7..f2356d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-08-29 Murray Cumming <murrayc murrayc com>
+
+ Entry: Add input purpose and input hints methods.
+
+ * gtk/src/entry.hg: Added get/set_input_purpose() and
+ get/set_input_hints() and properties.
+ * gtk/src/gtk_enums.defs:
+ * gtk/src/gtk_methods.defs: Regenerate.
+ * tools/m4/convert_gtk.m4: Add necessary conversions.
+
2012-08-29 Kjell Ahlstedt <kjell ahlstedt bredband net>
Application: Don't call add_window() before the application is registered.
diff --git a/gtk/src/entry.hg b/gtk/src/entry.hg
index 63e3b1d..862abc5 100644
--- a/gtk/src/entry.hg
+++ b/gtk/src/entry.hg
@@ -43,6 +43,8 @@ namespace Gtk
{
_WRAP_ENUM(EntryIconPosition, GtkEntryIconPosition)
+_WRAP_ENUM(InputPurpose, GtkInputPurpose)
+_WRAP_ENUM(InputHints, GtkInputHints)
/** A single line text entry field.
*
@@ -216,6 +218,12 @@ public:
_WRAP_METHOD(bool im_context_filter_keypress(GdkEventKey* event), gtk_entry_im_context_filter_keypress)
_WRAP_METHOD(void reset_im_context(), gtk_entry_reset_im_context)
+ _WRAP_METHOD(void set_input_purpose(InputPurpose purpose), gtk_entry_set_input_purpose)
+ _WRAP_METHOD(InputPurpose get_input_purpose() const, gtk_entry_get_input_purpose)
+
+ _WRAP_METHOD(void set_input_hints(InputHints hints), gtk_entry_set_input_hints)
+ _WRAP_METHOD(InputHints get_input_hints() const, gtk_entry_get_input_hints)
+
_WRAP_SIGNAL(void populate_popup(Menu* menu), "populate_popup")
#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
@@ -279,6 +287,8 @@ public:
_WRAP_PROPERTY("im-module", Glib::ustring)
_WRAP_PROPERTY("placeholder-text", Glib::ustring)
_WRAP_PROPERTY("completion", Glib::RefPtr<EntryCompletion>)
+ _WRAP_PROPERTY("input-purpose", InputPurpose)
+ _WRAP_PROPERTY("input-hints", InputHints)
};
} /* namespace Gtk */
diff --git a/gtk/src/gtk_enums.defs b/gtk/src/gtk_enums.defs
index ff6f677..779d60f 100644
--- a/gtk/src/gtk_enums.defs
+++ b/gtk/src/gtk_enums.defs
@@ -53,6 +53,26 @@
)
)
+;; From gtkactionhelper.h
+
+;; Original typedef:
+;; typedef enum
+;; {
+;; GTK_ACTION_HELPER_ROLE_NORMAL,
+;; GTK_ACTION_HELPER_ROLE_TOGGLE,
+;; GTK_ACTION_HELPER_ROLE_RADIO
+;; } GtkActionHelperRole;
+
+(define-enum-extended ActionHelperRole
+ (in-module "Gtk")
+ (c-name "GtkActionHelperRole")
+ (values
+ '("normal" "GTK_ACTION_HELPER_ROLE_NORMAL" "0")
+ '("toggle" "GTK_ACTION_HELPER_ROLE_TOGGLE" "1")
+ '("radio" "GTK_ACTION_HELPER_ROLE_RADIO" "2")
+ )
+)
+
;; From gtkapplication.h
;; Original typedef:
@@ -402,6 +422,25 @@
;; Original typedef:
;; typedef enum /*< skip >*/ {
+;; GTK_CSS_DEPENDS_ON_PARENT = (1 << 0),
+;; GTK_CSS_EQUALS_PARENT = (1 << 1),
+;; GTK_CSS_DEPENDS_ON_COLOR = (1 << 2),
+;; GTK_CSS_DEPENDS_ON_FONT_SIZE = (1 << 3)
+;; } GtkCssDependencies;
+
+(define-flags-extended CssDependencies
+ (in-module "Gtk")
+ (c-name "GtkCssDependencies")
+ (values
+ '("depends-on-parent" "GTK_CSS_DEPENDS_ON_PARENT" "(1 << 0)")
+ '("equals-parent" "GTK_CSS_EQUALS_PARENT" "(1 << 1)")
+ '("depends-on-color" "GTK_CSS_DEPENDS_ON_COLOR" "(1 << 2)")
+ '("depends-on-font-size" "GTK_CSS_DEPENDS_ON_FONT_SIZE" "(1 << 3)")
+ )
+)
+
+;; Original typedef:
+;; typedef enum /*< skip >*/ {
;; GTK_CSS_AREA_BORDER_BOX,
;; GTK_CSS_AREA_PADDING_BOX,
;; GTK_CSS_AREA_CONTENT_BOX
@@ -1773,6 +1812,83 @@
)
)
+;; Original typedef:
+;; typedef enum {
+;; GTK_LEVEL_BAR_MODE_CONTINUOUS,
+;; GTK_LEVEL_BAR_MODE_DISCRETE
+;; } GtkLevelBarMode;
+
+(define-enum-extended LevelBarMode
+ (in-module "Gtk")
+ (c-name "GtkLevelBarMode")
+ (values
+ '("continuous" "GTK_LEVEL_BAR_MODE_CONTINUOUS" "0")
+ '("discrete" "GTK_LEVEL_BAR_MODE_DISCRETE" "1")
+ )
+)
+
+;; Original typedef:
+;; typedef enum
+;; {
+;; GTK_INPUT_PURPOSE_FREE_FORM,
+;; GTK_INPUT_PURPOSE_ALPHA,
+;; GTK_INPUT_PURPOSE_DIGITS,
+;; GTK_INPUT_PURPOSE_NUMBER,
+;; GTK_INPUT_PURPOSE_PHONE,
+;; GTK_INPUT_PURPOSE_URL,
+;; GTK_INPUT_PURPOSE_EMAIL,
+;; GTK_INPUT_PURPOSE_NAME,
+;; GTK_INPUT_PURPOSE_PASSWORD,
+;; GTK_INPUT_PURPOSE_PIN
+;; } GtkInputPurpose;
+
+(define-enum-extended InputPurpose
+ (in-module "Gtk")
+ (c-name "GtkInputPurpose")
+ (values
+ '("free-form" "GTK_INPUT_PURPOSE_FREE_FORM" "0")
+ '("alpha" "GTK_INPUT_PURPOSE_ALPHA" "1")
+ '("digits" "GTK_INPUT_PURPOSE_DIGITS" "2")
+ '("number" "GTK_INPUT_PURPOSE_NUMBER" "3")
+ '("phone" "GTK_INPUT_PURPOSE_PHONE" "4")
+ '("url" "GTK_INPUT_PURPOSE_URL" "5")
+ '("email" "GTK_INPUT_PURPOSE_EMAIL" "6")
+ '("name" "GTK_INPUT_PURPOSE_NAME" "7")
+ '("password" "GTK_INPUT_PURPOSE_PASSWORD" "8")
+ '("pin" "GTK_INPUT_PURPOSE_PIN" "9")
+ )
+)
+
+;; Original typedef:
+;; typedef enum
+;; {
+;; GTK_INPUT_HINT_NONE = 0,
+;; GTK_INPUT_HINT_SPELLCHECK = 1 << 0,
+;; GTK_INPUT_HINT_NO_SPELLCHECK = 1 << 1,
+;; GTK_INPUT_HINT_WORD_COMPLETION = 1 << 2,
+;; GTK_INPUT_HINT_LOWERCASE = 1 << 3,
+;; GTK_INPUT_HINT_UPPERCASE_CHARS = 1 << 4,
+;; GTK_INPUT_HINT_UPPERCASE_WORDS = 1 << 5,
+;; GTK_INPUT_HINT_UPPERCASE_SENTENCES = 1 << 6,
+;; GTK_INPUT_HINT_INHIBIT_OSK = 1 << 7
+;; } GtkInputHints;
+
+(define-flags-extended InputHints
+ (in-module "Gtk")
+ (c-name "GtkInputHints")
+ (values
+ '("none" "GTK_INPUT_HINT_NONE" "0x0")
+ '("spellcheck" "GTK_INPUT_HINT_SPELLCHECK" "1 << 0")
+ '("no-spellcheck" "GTK_INPUT_HINT_NO_SPELLCHECK" "1 << 1")
+ '("word-completion" "GTK_INPUT_HINT_WORD_COMPLETION" "1 << 2")
+ '("lowercase" "GTK_INPUT_HINT_LOWERCASE" "1 << 3")
+ '("uppercase-chars" "GTK_INPUT_HINT_UPPERCASE_CHARS" "1 << 4")
+ '("uppercase-words" "GTK_INPUT_HINT_UPPERCASE_WORDS" "1 << 5")
+ '("uppercase-sentences" "GTK_INPUT_HINT_UPPERCASE_SENTENCES" "1 << 6")
+ '("inhibit-osk" "GTK_INPUT_HINT_INHIBIT_OSK" "1 << 7")
+ )
+)
+
;; From gtkfilechooser.h
;; Original typedef:
diff --git a/gtk/src/gtk_methods.defs b/gtk/src/gtk_methods.defs
index d6f8ed1..0b2b83f 100644
--- a/gtk/src/gtk_methods.defs
+++ b/gtk/src/gtk_methods.defs
@@ -837,6 +837,13 @@
(gtype-id "GTK_TYPE_ACCEL_LABEL")
)
+(define-object LevelBar
+ (in-module "Gtk")
+ (parent "GtkWidget")
+ (c-name "GtkLevelBar")
+ (gtype-id "GTK_TYPE_LEVEL_BAR")
+)
+
(define-object Invisible
(in-module "Gtk")
(parent "GtkWidget")
@@ -1616,6 +1623,17 @@
)
)
+(define-enum ActionHelperRole
+ (in-module "Gtk")
+ (c-name "GtkActionHelperRole")
+ (gtype-id "GTK_TYPE_ACTION_HELPER_ROLE")
+ (values
+ '("normal" "GTK_ACTION_HELPER_ROLE_NORMAL")
+ '("toggle" "GTK_ACTION_HELPER_ROLE_TOGGLE")
+ '("radio" "GTK_ACTION_HELPER_ROLE_RADIO")
+ )
+)
+
(define-flags ApplicationInhibitFlags
(in-module "Gtk")
(c-name "GtkApplicationInhibitFlags")
@@ -1804,6 +1822,18 @@
)
)
+(define-flags CssDependencies
+ (in-module "Gtk")
+ (c-name "GtkCssDependencies")
+ (gtype-id "GTK_TYPE_CSS_DEPENDENCIES")
+ (values
+ '("depends-on-parent" "GTK_CSS_DEPENDS_ON_PARENT")
+ '("equals-parent" "GTK_CSS_EQUALS_PARENT")
+ '("depends-on-color" "GTK_CSS_DEPENDS_ON_COLOR")
+ '("depends-on-font-size" "GTK_CSS_DEPENDS_ON_FONT_SIZE")
+ )
+)
+
(define-enum CssArea
(in-module "Gtk")
(c-name "GtkCssArea")
@@ -2611,6 +2641,51 @@
)
)
+(define-enum LevelBarMode
+ (in-module "Gtk")
+ (c-name "GtkLevelBarMode")
+ (gtype-id "GTK_TYPE_LEVEL_BAR_MODE")
+ (values
+ '("continuous" "GTK_LEVEL_BAR_MODE_CONTINUOUS")
+ '("discrete" "GTK_LEVEL_BAR_MODE_DISCRETE")
+ )
+)
+
+(define-enum InputPurpose
+ (in-module "Gtk")
+ (c-name "GtkInputPurpose")
+ (gtype-id "GTK_TYPE_INPUT_PURPOSE")
+ (values
+ '("free-form" "GTK_INPUT_PURPOSE_FREE_FORM")
+ '("alpha" "GTK_INPUT_PURPOSE_ALPHA")
+ '("digits" "GTK_INPUT_PURPOSE_DIGITS")
+ '("number" "GTK_INPUT_PURPOSE_NUMBER")
+ '("phone" "GTK_INPUT_PURPOSE_PHONE")
+ '("url" "GTK_INPUT_PURPOSE_URL")
+ '("email" "GTK_INPUT_PURPOSE_EMAIL")
+ '("name" "GTK_INPUT_PURPOSE_NAME")
+ '("password" "GTK_INPUT_PURPOSE_PASSWORD")
+ '("pin" "GTK_INPUT_PURPOSE_PIN")
+ )
+)
+
+(define-flags InputHints
+ (in-module "Gtk")
+ (c-name "GtkInputHints")
+ (gtype-id "GTK_TYPE_INPUT_HINTS")
+ (values
+ '("none" "GTK_INPUT_HINT_NONE")
+ '("spellcheck" "GTK_INPUT_HINT_SPELLCHECK")
+ '("no-spellcheck" "GTK_INPUT_HINT_NO_SPELLCHECK")
+ '("word-completion" "GTK_INPUT_HINT_WORD_COMPLETION")
+ '("lowercase" "GTK_INPUT_HINT_LOWERCASE")
+ '("uppercase-chars" "GTK_INPUT_HINT_UPPERCASE_CHARS")
+ '("uppercase-words" "GTK_INPUT_HINT_UPPERCASE_WORDS")
+ '("uppercase-sentences" "GTK_INPUT_HINT_UPPERCASE_SENTENCES")
+ '("inhibit-osk" "GTK_INPUT_HINT_INHIBIT_OSK")
+ )
+)
+
(define-enum FileChooserAction
(in-module "Gtk")
(c-name "GtkFileChooserAction")
@@ -3311,10 +3386,6 @@
-;; From gsimpleactionobserver.h
-
-
-
;; From gtkaboutdialog.h
(define-function gtk_about_dialog_get_type
@@ -4584,6 +4655,10 @@
+;; From gtkactionhelper.h
+
+
+
;; From gtkactivatable.h
(define-function gtk_activatable_get_type
@@ -5278,6 +5353,12 @@
)
)
+(define-method get_active_window
+ (of-object "GtkApplication")
+ (c-name "gtk_application_get_active_window")
+ (return-type "GtkWindow*")
+)
+
;; From gtkapplicationprivate.h
@@ -11123,6 +11204,36 @@
(return-type "none")
)
+(define-method set_input_purpose
+ (of-object "GtkEntry")
+ (c-name "gtk_entry_set_input_purpose")
+ (return-type "none")
+ (parameters
+ '("GtkInputPurpose" "purpose")
+ )
+)
+
+(define-method get_input_purpose
+ (of-object "GtkEntry")
+ (c-name "gtk_entry_get_input_purpose")
+ (return-type "GtkInputPurpose")
+)
+
+(define-method set_input_hints
+ (of-object "GtkEntry")
+ (c-name "gtk_entry_set_input_hints")
+ (return-type "none")
+ (parameters
+ '("GtkInputHints" "hints")
+ )
+)
+
+(define-method get_input_hints
+ (of-object "GtkEntry")
+ (c-name "gtk_entry_get_input_hints")
+ (return-type "GtkInputHints")
+)
+
;; From gtkentryprivate.h
@@ -14926,6 +15037,119 @@
+;; From gtklevelbar.h
+
+(define-function gtk_level_bar_get_type
+ (c-name "gtk_level_bar_get_type")
+ (return-type "GType")
+)
+
+(define-function gtk_level_bar_new
+ (c-name "gtk_level_bar_new")
+ (is-constructor-of "GtkLevelBar")
+ (return-type "GtkWidget*")
+)
+
+(define-function gtk_level_bar_new_for_interval
+ (c-name "gtk_level_bar_new_for_interval")
+ (return-type "GtkWidget*")
+ (parameters
+ '("gdouble" "min_value")
+ '("gdouble" "max_value")
+ )
+)
+
+(define-method set_mode
+ (of-object "GtkLevelBar")
+ (c-name "gtk_level_bar_set_mode")
+ (return-type "none")
+ (parameters
+ '("GtkLevelBarMode" "mode")
+ )
+)
+
+(define-method get_mode
+ (of-object "GtkLevelBar")
+ (c-name "gtk_level_bar_get_mode")
+ (return-type "GtkLevelBarMode")
+)
+
+(define-method set_value
+ (of-object "GtkLevelBar")
+ (c-name "gtk_level_bar_set_value")
+ (return-type "none")
+ (parameters
+ '("gdouble" "value")
+ )
+)
+
+(define-method get_value
+ (of-object "GtkLevelBar")
+ (c-name "gtk_level_bar_get_value")
+ (return-type "gdouble")
+)
+
+(define-method set_min_value
+ (of-object "GtkLevelBar")
+ (c-name "gtk_level_bar_set_min_value")
+ (return-type "none")
+ (parameters
+ '("gdouble" "value")
+ )
+)
+
+(define-method get_min_value
+ (of-object "GtkLevelBar")
+ (c-name "gtk_level_bar_get_min_value")
+ (return-type "gdouble")
+)
+
+(define-method set_max_value
+ (of-object "GtkLevelBar")
+ (c-name "gtk_level_bar_set_max_value")
+ (return-type "none")
+ (parameters
+ '("gdouble" "value")
+ )
+)
+
+(define-method get_max_value
+ (of-object "GtkLevelBar")
+ (c-name "gtk_level_bar_get_max_value")
+ (return-type "gdouble")
+)
+
+(define-method add_offset_value
+ (of-object "GtkLevelBar")
+ (c-name "gtk_level_bar_add_offset_value")
+ (return-type "none")
+ (parameters
+ '("const-gchar*" "name")
+ '("gdouble" "value")
+ )
+)
+
+(define-method remove_offset_value
+ (of-object "GtkLevelBar")
+ (c-name "gtk_level_bar_remove_offset_value")
+ (return-type "none")
+ (parameters
+ '("const-gchar*" "name")
+ )
+)
+
+(define-method get_offset_value
+ (of-object "GtkLevelBar")
+ (c-name "gtk_level_bar_get_offset_value")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "name")
+ '("gdouble*" "value")
+ )
+)
+
+
+
;; From gtklinkbutton.h
(define-function gtk_link_button_get_type
@@ -15575,6 +15799,21 @@
(return-type "GtkWidget*")
)
+(define-method set_popup
+ (of-object "GtkMenuButton")
+ (c-name "gtk_menu_button_set_popup")
+ (return-type "none")
+ (parameters
+ '("GtkWidget*" "popup")
+ )
+)
+
+(define-method get_popup
+ (of-object "GtkMenuButton")
+ (c-name "gtk_menu_button_get_popup")
+ (return-type "GtkMenu*")
+)
+
(define-method set_menu
(of-object "GtkMenuButton")
(c-name "gtk_menu_button_set_menu")
@@ -16366,10 +16605,15 @@
(return-type "none")
(parameters
'("GMenuModel*" "model")
- '("GActionObservable*" "observable")
+ '("GtkApplication*" "application")
)
)
+(define-function gtk_quartz_clear_main_menu
+ (c-name "gtk_quartz_clear_main_menu")
+ (return-type "none")
+)
+
;; From gtkmodifierstyle.h
@@ -26954,6 +27198,36 @@
(return-type "GtkTextAttributes*")
)
+(define-method set_input_purpose
+ (of-object "GtkTextView")
+ (c-name "gtk_text_view_set_input_purpose")
+ (return-type "none")
+ (parameters
+ '("GtkInputPurpose" "purpose")
+ )
+)
+
+(define-method get_input_purpose
+ (of-object "GtkTextView")
+ (c-name "gtk_text_view_get_input_purpose")
+ (return-type "GtkInputPurpose")
+)
+
+(define-method set_input_hints
+ (of-object "GtkTextView")
+ (c-name "gtk_text_view_set_input_hints")
+ (return-type "none")
+ (parameters
+ '("GtkInputHints" "hints")
+ )
+)
+
+(define-method get_input_hints
+ (of-object "GtkTextView")
+ (c-name "gtk_text_view_get_input_hints")
+ (return-type "GtkInputHints")
+)
+
;; From gtkthemingbackgroundprivate.h
@@ -31238,6 +31512,21 @@
(return-type "GType")
)
+(define-function gtk_level_bar_mode_get_type
+ (c-name "gtk_level_bar_mode_get_type")
+ (return-type "GType")
+)
+
+(define-function gtk_input_purpose_get_type
+ (c-name "gtk_input_purpose_get_type")
+ (return-type "GType")
+)
+
+(define-function gtk_input_hints_get_type
+ (c-name "gtk_input_hints_get_type")
+ (return-type "GType")
+)
+
(define-function gtk_file_chooser_action_get_type
(c-name "gtk_file_chooser_action_get_type")
(return-type "GType")
@@ -33241,6 +33530,16 @@
)
)
+(define-method insert_action_group
+ (of-object "GtkWidget")
+ (c-name "gtk_widget_insert_action_group")
+ (return-type "none")
+ (parameters
+ '("const-gchar*" "name")
+ '("GActionGroup*" "group")
+ )
+)
+
;; From gtkwidgetpath.h
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 6a88aa1..0329b4d 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -156,6 +156,8 @@ _CONV_ENUM(Gtk,RegionFlags)
_CONV_ENUM(Gtk,JunctionSides)
_CONV_ENUM(Gtk,StateFlags)
_CONV_ENUM(Gtk,ApplicationInhibitFlags)
+_CONV_ENUM(Gtk,InputPurpose)
+_CONV_ENUM(Gtk,InputHints)
_CONVERSION(`GtkIconSize',`IconSize',`IconSize(static_cast<int>($3))')
_CONVERSION(`GtkIconSize',`Gtk::IconSize',`Gtk::IconSize(static_cast<int>($3))')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]