[sugar] [PATCH 1/2] Add is_modifier and is_special_modifier functions to SugarKeyGrabber.

Marco Pesenti Gritti mpgritti
Fri Jun 20 04:49:57 EDT 2008


On Thu, Jun 19, 2008 at 9:06 PM, Benjamin Berg
<benjamin at sipsolutions.net> wrote:
> +       modmap = XGetModifierMapping (xdisplay);

No space between function name and (

> +gboolean sugar_key_grabber_is_modifier          (SugarKeyGrabber *grabber,
> +                                                 guint            keycode);
> +gboolean sugar_key_grabber_is_specific_modifier (SugarKeyGrabber *grabber,
> +                                                 guint            keycode,
> +                                                 guint            mask);
> +

What about collapsing this in a single function and making it look
like this in python:

key_grabber.is_modifier(keycode, mask=-1)

You can do that in the bindings with something like this:

(define-method set
  (of-object "GtkAspectFrame")
  (c-name "gtk_aspect_frame_set")
  (return-type "none")
  (parameters
    '("gfloat" "xalign" (default "0.0"))
    '("gfloat" "yalign" (default "0.0"))
    '("gfloat" "ratio" (default "1.0"))
    '("gboolean" "obey_child" (default "1"))
  )
)

r+ with those changes.

Marco



More information about the Sugar-devel mailing list