Esempio n. 1
0
static void
hippo_canvas_text_class_init(HippoCanvasTextClass *klass)
{
    GObjectClass *object_class = G_OBJECT_CLASS (klass);
    HippoCanvasBoxClass *box_class = HIPPO_CANVAS_BOX_CLASS(klass);
    
    object_class->set_property = hippo_canvas_text_set_property;
    object_class->get_property = hippo_canvas_text_get_property;

    object_class->finalize = hippo_canvas_text_finalize;

    box_class->paint_below_children = hippo_canvas_text_paint_below_children;
    box_class->get_content_width_request = hippo_canvas_text_get_content_width_request;
    box_class->get_content_height_request = hippo_canvas_text_get_content_height_request;

    /**
     * HippoCanvasText:text
     *
     * The text to display.
     */
    g_object_class_install_property(object_class,
                                    PROP_TEXT,
                                    g_param_spec_string("text",
                                                        _("Text"),
                                                        _("Text to display"),
                                                        NULL,
                                                        G_PARAM_READABLE | G_PARAM_WRITABLE));

    /**
     * HippoCanvasText:markup
     *
     * The text to display in Pango markup format, allowing you to do bold and other text styles.
     * This is a shortcut way to set the 'text' and 'attributes' properties.
     */    
    g_object_class_install_property(object_class,
                                    PROP_MARKUP,
                                    g_param_spec_string("markup",
                                                        _("Markup"),
                                                        _("Marked-up text to display"),
                                                        NULL,
                                                        G_PARAM_WRITABLE));

    
    /**
     * HippoCanvasText:attributes
     *
     * The Pango attributes of the text; usually it is more convenient to use the 'markup' property
     * than to do the attributes by hand.
     */    
    g_object_class_install_property(object_class,
                                    PROP_ATTRIBUTES,
                                    g_param_spec_boxed ("attributes",
                                                        _("Attributes"),
                                                        _("A list of style attributes to apply to the text"),
                                                        PANGO_TYPE_ATTR_LIST,
                                                        G_PARAM_READABLE | G_PARAM_WRITABLE));

    /**
     * HippoCanvasText:font-scale
     *
     * A scale factor for the font; Pango exports constants for common
     * factors, such as #PANGO_SCALE_LARGE, #PANGO_SCALE_X_SMALL and
     * so forth. If you want to set an absolute font size, use the
     * 'font' or 'font-desc' properties which are introduced in the
     * HippoCanvasBox base class.
     */
    g_object_class_install_property(object_class,
                                    PROP_FONT_SCALE,
                                    g_param_spec_double("font-scale",
                                                        _("Font scale"),
                                                        _("Scale factor for fonts"),
                                                        0.0,
                                                        100.0,
                                                        1.0,
                                                        G_PARAM_READABLE | G_PARAM_WRITABLE));

    /**
     * HippoCanvasText:size-mode
     *
     * Three "size modes" are available. In #HIPPO_CANVAS_SIZE_FULL_WIDTH mode, the
     * text item will give the width of its text as its minimum size. In #HIPPO_CANVAS_SIZE_WRAP_WORD,
     * the text item will wrap to fit available space - its minimum width will be pretty small, but as
     * the width decreases its height will increase. In #HIPPO_CANVAS_SIZE_ELLIPSIZE_END mode, the
     * width of the text will be the natural width of the item, but the minimum width will be small.
     * If the item gets less than its natural width, it will ellipsize the text in order to fit
     * in available space.
     *
     * If none of that made sense, just decide whether you want to
     * always display all the text without wrapping, want to be able
     * to wrap as the available space shrinks, or want to ellipsize
     * the text as the available space shrinks.
     */
    g_object_class_install_property(object_class,
                                    PROP_SIZE_MODE,
                                    g_param_spec_enum("size-mode",
                                                      _("Size mode"),
                                                      _("Mode for size request and allocation"),
                                                      HIPPO_TYPE_CANVAS_SIZE_MODE,
                                                      HIPPO_CANVAS_SIZE_FULL_WIDTH,
                                                      G_PARAM_READABLE | G_PARAM_WRITABLE));    
}
Esempio n. 2
0
void
gst_frei0r_klass_install_properties (GObjectClass * gobject_class,
    GstFrei0rFuncTable * ftable, GstFrei0rProperty * properties,
    gint n_properties)
{
  gint i, count = 1;
  f0r_instance_t *instance = ftable->construct (640, 480);

  g_assert (instance);

  for (i = 0; i < n_properties; i++) {
    f0r_param_info_t *param_info = &properties[i].info;
    gchar *prop_name;

    ftable->get_param_info (param_info, i);

    if (!param_info->name) {
      GST_ERROR ("Property %d of %s without a valid name", i,
          g_type_name (G_TYPE_FROM_CLASS (gobject_class)));
      continue;
    }

    prop_name = g_ascii_strdown (param_info->name, -1);
    g_strcanon (prop_name, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-+", '-');
    /* satisfy glib2 (argname[0] must be [A-Za-z]) */
    if (!((prop_name[0] >= 'a' && prop_name[0] <= 'z') ||
            (prop_name[0] >= 'A' && prop_name[0] <= 'Z'))) {
      gchar *tempstr = prop_name;

      prop_name = g_strconcat ("param-", prop_name, NULL);
      g_free (tempstr);
    }

    properties[i].prop_id = count;
    properties[i].prop_idx = i;

    ftable->get_param_value (instance, &properties[i].default_value, i);
    if (param_info->type == F0R_PARAM_STRING)
      properties[i].default_value.data.s =
          g_strdup (properties[i].default_value.data.s);

    switch (param_info->type) {
      case F0R_PARAM_BOOL:
        g_object_class_install_property (gobject_class, count++,
            g_param_spec_boolean (prop_name, param_info->name,
                param_info->explanation,
                properties[i].default_value.data.b ? TRUE : FALSE,
                G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
        properties[i].n_prop_ids = 1;
        break;
      case F0R_PARAM_DOUBLE:{
        gdouble def = properties[i].default_value.data.d;

        /* If the default is NAN, +-INF we use 0.0 */
        if (!(def <= G_MAXDOUBLE && def >= -G_MAXDOUBLE))
          def = 0.0;

        g_object_class_install_property (gobject_class, count++,
            g_param_spec_double (prop_name, param_info->name,
                param_info->explanation, -G_MAXDOUBLE, G_MAXDOUBLE, def,
                G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
        properties[i].n_prop_ids = 1;
        break;
      }
      case F0R_PARAM_STRING:
        g_object_class_install_property (gobject_class, count++,
            g_param_spec_string (prop_name, param_info->name,
                param_info->explanation, properties[i].default_value.data.s,
                G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
        properties[i].n_prop_ids = 1;
        break;
      case F0R_PARAM_COLOR:{
        gchar *prop_name_full;
        gchar *prop_nick_full;
        gdouble def;

        def = properties[i].default_value.data.color.r;
        /* If the default is out of range we use 0.0 */
        if (!(def <= 1.0 && def >= 0.0))
          def = 0.0;
        prop_name_full = g_strconcat (prop_name, "-r", NULL);
        prop_nick_full = g_strconcat (param_info->name, "-R", NULL);
        g_object_class_install_property (gobject_class, count++,
            g_param_spec_float (prop_name_full, prop_nick_full,
                param_info->explanation, 0.0, 1.0, def,
                G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
        g_free (prop_name_full);
        g_free (prop_nick_full);

        def = properties[i].default_value.data.color.g;
        /* If the default is out of range we use 0.0 */
        if (!(def <= 1.0 && def >= 0.0))
          def = 0.0;
        prop_name_full = g_strconcat (prop_name, "-g", NULL);
        prop_nick_full = g_strconcat (param_info->name, "-G", NULL);
        g_object_class_install_property (gobject_class, count++,
            g_param_spec_float (prop_name_full, param_info->name,
                param_info->explanation, 0.0, 1.0, def,
                G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
        g_free (prop_name_full);
        g_free (prop_nick_full);

        def = properties[i].default_value.data.color.b;
        /* If the default is out of range we use 0.0 */
        if (!(def <= 1.0 && def >= 0.0))
          def = 0.0;
        prop_name_full = g_strconcat (prop_name, "-b", NULL);
        prop_nick_full = g_strconcat (param_info->name, "-B", NULL);
        g_object_class_install_property (gobject_class, count++,
            g_param_spec_float (prop_name_full, param_info->name,
                param_info->explanation, 0.0, 1.0, def,
                G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
        g_free (prop_name_full);
        g_free (prop_nick_full);

        properties[i].n_prop_ids = 3;
        break;
      }
      case F0R_PARAM_POSITION:{
        gchar *prop_name_full;
        gchar *prop_nick_full;
        gdouble def;

        def = properties[i].default_value.data.position.x;
        /* If the default is out of range we use 0.0 */
        if (!(def <= 1.0 && def >= 0.0))
          def = 0.0;
        prop_name_full = g_strconcat (prop_name, "-x", NULL);
        prop_nick_full = g_strconcat (param_info->name, "-X", NULL);
        g_object_class_install_property (gobject_class, count++,
            g_param_spec_double (prop_name_full, param_info->name,
                param_info->explanation, 0.0, 1.0, def,
                G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
        g_free (prop_name_full);
        g_free (prop_nick_full);

        def = properties[i].default_value.data.position.y;
        /* If the default is out of range we use 0.0 */
        if (!(def <= 1.0 && def >= 0.0))
          def = 0.0;
        prop_name_full = g_strconcat (prop_name, "-Y", NULL);
        prop_nick_full = g_strconcat (param_info->name, "-X", NULL);
        g_object_class_install_property (gobject_class, count++,
            g_param_spec_double (prop_name_full, param_info->name,
                param_info->explanation, 0.0, 1.0, def,
                G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
        g_free (prop_name_full);
        g_free (prop_nick_full);

        properties[i].n_prop_ids = 2;
        break;
      }
      default:
        g_assert_not_reached ();
        break;
    }

    g_free (prop_name);
  }

  ftable->destruct (instance);
}
Esempio n. 3
0
static void
gdk_screen_class_init (GdkScreenClass *klass)
{
    GObjectClass *object_class = G_OBJECT_CLASS (klass);

    object_class->finalize = gdk_screen_finalize;
    object_class->set_property = gdk_screen_set_property;
    object_class->get_property = gdk_screen_get_property;

    g_object_class_install_property (object_class,
                                     PROP_FONT_OPTIONS,
                                     g_param_spec_pointer ("font-options",
                                             P_("Font options"),
                                             P_("The default font options for the screen"),
                                             G_PARAM_READWRITE|G_PARAM_STATIC_NAME|
                                             G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));

    g_object_class_install_property (object_class,
                                     PROP_RESOLUTION,
                                     g_param_spec_double ("resolution",
                                             P_("Font resolution"),
                                             P_("The resolution for fonts on the screen"),
                                             -1.0,
                                             10000.0,
                                             -1.0,
                                             G_PARAM_READWRITE|G_PARAM_STATIC_NAME|
                                             G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));

    /**
     * GdkScreen::size-changed:
     * @screen: the object on which the signal is emitted
     *
     * The ::size-changed signal is emitted when the pixel width or
     * height of a screen changes.
     *
     * Since: 2.2
     */
    signals[SIZE_CHANGED] =
        g_signal_new (g_intern_static_string ("size-changed"),
                      G_OBJECT_CLASS_TYPE (klass),
                      G_SIGNAL_RUN_LAST,
                      G_STRUCT_OFFSET (GdkScreenClass, size_changed),
                      NULL, NULL,
                      g_cclosure_marshal_VOID__VOID,
                      G_TYPE_NONE,
                      0);

    /**
     * GdkScreen::composited-changed:
     * @screen: the object on which the signal is emitted
     *
     * The ::composited-changed signal is emitted when the composited
     * status of the screen changes
     *
     * Since: 2.10
     */
    signals[COMPOSITED_CHANGED] =
        g_signal_new (g_intern_static_string ("composited-changed"),
                      G_OBJECT_CLASS_TYPE (klass),
                      G_SIGNAL_RUN_LAST,
                      G_STRUCT_OFFSET (GdkScreenClass, composited_changed),
                      NULL, NULL,
                      g_cclosure_marshal_VOID__VOID,
                      G_TYPE_NONE,
                      0);

    /**
     * GdkScreen::monitors-changed:
     * @screen: the object on which the signal is emitted
     *
     * The ::monitors-changed signal is emitted when the number, size
     * or position of the monitors attached to the screen change.
     *
     * Only for X11 and OS X for now. A future implementation for Win32
     * may be a possibility.
     *
     * Since: 2.14
     */
    signals[MONITORS_CHANGED] =
        g_signal_new (g_intern_static_string ("monitors-changed"),
                      G_OBJECT_CLASS_TYPE (klass),
                      G_SIGNAL_RUN_LAST,
                      G_STRUCT_OFFSET (GdkScreenClass, monitors_changed),
                      NULL, NULL,
                      g_cclosure_marshal_VOID__VOID,
                      G_TYPE_NONE,
                      0);
}
Esempio n. 4
0
static void
gst_video_rate_class_init (GstVideoRateClass * klass)
{
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
  GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
  GstBaseTransformClass *base_class = GST_BASE_TRANSFORM_CLASS (klass);

  object_class->set_property = gst_video_rate_set_property;
  object_class->get_property = gst_video_rate_get_property;

  base_class->set_caps = GST_DEBUG_FUNCPTR (gst_video_rate_setcaps);
  base_class->transform_caps =
      GST_DEBUG_FUNCPTR (gst_video_rate_transform_caps);
  base_class->transform_ip = GST_DEBUG_FUNCPTR (gst_video_rate_transform_ip);
  base_class->sink_event = GST_DEBUG_FUNCPTR (gst_video_rate_sink_event);
  base_class->start = GST_DEBUG_FUNCPTR (gst_video_rate_start);
  base_class->stop = GST_DEBUG_FUNCPTR (gst_video_rate_stop);
  base_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_video_rate_fixate_caps);
  base_class->query = GST_DEBUG_FUNCPTR (gst_video_rate_query);

  g_object_class_install_property (object_class, PROP_IN,
      g_param_spec_uint64 ("in", "In",
          "Number of input frames", 0, G_MAXUINT64, 0,
          G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (object_class, PROP_OUT,
      g_param_spec_uint64 ("out", "Out", "Number of output frames", 0,
          G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
  pspec_duplicate = g_param_spec_uint64 ("duplicate", "Duplicate",
      "Number of duplicated frames", 0, G_MAXUINT64, 0,
      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_DUP, pspec_duplicate);
  pspec_drop = g_param_spec_uint64 ("drop", "Drop", "Number of dropped frames",
      0, G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (object_class, PROP_DROP, pspec_drop);
  g_object_class_install_property (object_class, PROP_SILENT,
      g_param_spec_boolean ("silent", "silent",
          "Don't emit notify for dropped and duplicated frames", DEFAULT_SILENT,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (object_class, PROP_NEW_PREF,
      g_param_spec_double ("new-pref", "New Pref",
          "Value indicating how much to prefer new frames (unused)", 0.0, 1.0,
          DEFAULT_NEW_PREF, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  /**
   * GstVideoRate:skip-to-first:
   *
   * Don't produce buffers before the first one we receive.
   *
   * Since: 0.10.25
   */
  g_object_class_install_property (object_class, PROP_SKIP_TO_FIRST,
      g_param_spec_boolean ("skip-to-first", "Skip to first buffer",
          "Don't produce buffers before the first one we receive",
          DEFAULT_SKIP_TO_FIRST, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  /**
   * GstVideoRate:drop-only:
   *
   * Only drop frames, no duplicates are produced.
   *
   * Since: 0.10.36
   */
  g_object_class_install_property (object_class, PROP_DROP_ONLY,
      g_param_spec_boolean ("drop-only", "Only Drop",
          "Only drop frames, no duplicates are produced",
          DEFAULT_DROP_ONLY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  /**
   * GstVideoRate:average-period:
   *
   * Arrange for maximum framerate by dropping frames beyond a certain framerate,
   * where the framerate is calculated using a moving average over the
   * configured.
   *
   * Since: 0.10.36
   */
  g_object_class_install_property (object_class, PROP_AVERAGE_PERIOD,
      g_param_spec_uint64 ("average-period", "Period over which to average",
          "Period over which to average the framerate (in ns) (0 = disabled)",
          0, G_MAXINT64, DEFAULT_AVERAGE_PERIOD,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  /**
   * GstVideoRate:max-rate:
   *
   * maximum framerate to pass through
   *
   * Since: 0.10.36
   */
  g_object_class_install_property (object_class, PROP_MAX_RATE,
      g_param_spec_int ("max-rate", "maximum framerate",
          "Maximum framerate allowed to pass through "
          "(in frames per second, implies drop-only)",
          1, G_MAXINT, DEFAULT_MAX_RATE,
          G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));

  /**
   * GstVideoRate:rate:
   *
   * Factor of speed for frame displaying
   *
   * Since: 1.2
   */
  g_object_class_install_property (object_class, PROP_RATE,
      g_param_spec_double ("rate", "Rate",
          "Factor of speed for frame displaying", 0.0, G_MAXDOUBLE,
          DEFAULT_RATE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  gst_element_class_set_static_metadata (element_class,
      "Video rate adjuster", "Filter/Effect/Video",
      "Drops/duplicates/adjusts timestamps on video frames to make a perfect stream",
      "Wim Taymans <*****@*****.**>");

  gst_element_class_add_pad_template (element_class,
      gst_static_pad_template_get (&gst_video_rate_sink_template));
  gst_element_class_add_pad_template (element_class,
      gst_static_pad_template_get (&gst_video_rate_src_template));
}
static void
dmap_connection_class_init (DMAPConnectionClass * klass)
{
	GObjectClass *object_class = G_OBJECT_CLASS (klass);

	klass->get_protocol_version_cc = NULL;
	klass->get_query_metadata = NULL;
	klass->handle_mlcl = NULL;

	object_class->finalize = dmap_connection_finalize;
	object_class->dispose = dmap_connection_dispose;
	object_class->set_property = dmap_connection_set_property;
	object_class->get_property = dmap_connection_get_property;

	g_type_class_add_private (klass, sizeof (DMAPConnectionPrivate));

	g_object_class_install_property (object_class,
					 PROP_DB,
					 g_param_spec_pointer ("db",
							       "DMAPDb",
							       "DMAPDb object",
							       G_PARAM_READWRITE
							       |
							       G_PARAM_CONSTRUCT_ONLY));

	g_object_class_install_property (object_class,
					 PROP_FACTORY,
					 g_param_spec_pointer ("factory",
							       "record factory",
							       "record factory",
							       G_PARAM_READWRITE
							       |
							       G_PARAM_CONSTRUCT_ONLY));

	g_object_class_install_property (object_class,
					 PROP_PASSWORD_PROTECTED,
					 g_param_spec_boolean
					 ("password-protected",
					  "password protected",
					  "connection is password protected",
					  FALSE,
					  G_PARAM_READWRITE |
					  G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (object_class, PROP_NAME,
					 g_param_spec_string ("name",
							      "connection name",
							      "connection name",
							      NULL,
							      G_PARAM_READWRITE
							      |
							      G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (object_class, PROP_HOST,
					 g_param_spec_string ("host", "host",
							      "host", NULL,
							      G_PARAM_READWRITE
							      |
							      G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (object_class, PROP_PORT,
					 g_param_spec_uint ("port", "port",
							    "port", 0,
							    G_MAXINT, 0,
							    G_PARAM_READWRITE
							    |
							    G_PARAM_CONSTRUCT_ONLY));

	g_object_class_install_property (object_class,
					 PROP_BASE_URI,
					 g_param_spec_pointer ("base-uri",
							       "base URI",
							       "base URI",
							       G_PARAM_READWRITE));

	g_object_class_install_property (object_class,
					 PROP_DATABASE_ID,
					 g_param_spec_int ("database-id",
							   "database ID",
							   "database ID",
							   0, G_MAXINT, 0,
							   G_PARAM_READWRITE));

	g_object_class_install_property (object_class,
					 PROP_SESSION_ID,
					 g_param_spec_int ("session-id",
							   "session ID",
							   "session ID",
							   0, G_MAXINT, 0,
							   G_PARAM_READWRITE));

	g_object_class_install_property (object_class,
					 PROP_DMAP_VERSION,
					 g_param_spec_double ("dmap-version",
							      "DMAP version",
							      "DMAP version",
							      0, G_MAXDOUBLE,
							      0,
							      G_PARAM_READWRITE));

	g_object_class_install_property (object_class,
					 PROP_REVISION_NUMBER,
					 g_param_spec_int ("revision-number",
							   "revision number",
							   "revision number",
							   0, G_MAXINT, 0,
							   G_PARAM_READWRITE));

	signals[AUTHENTICATE] = g_signal_new ("authenticate",
					      G_TYPE_FROM_CLASS
					      (object_class),
					      G_SIGNAL_RUN_LAST,
					      G_STRUCT_OFFSET
					      (DMAPConnectionClass,
					       authenticate), NULL, NULL,
					      dmap_marshal_STRING__STRING,
					      G_TYPE_STRING, 1,
					      G_TYPE_STRING);
	signals[CONNECTING] =
		g_signal_new ("connecting", G_TYPE_FROM_CLASS (object_class),
			      G_SIGNAL_RUN_LAST,
			      G_STRUCT_OFFSET (DMAPConnectionClass,
					       connecting), NULL, NULL,
			      dmap_marshal_VOID__ULONG_FLOAT, G_TYPE_NONE, 2,
			      G_TYPE_ULONG, G_TYPE_FLOAT);
	signals[CONNECTED] =
		g_signal_new ("connected", G_TYPE_FROM_CLASS (object_class),
			      G_SIGNAL_RUN_LAST,
			      G_STRUCT_OFFSET (DMAPConnectionClass,
					       connected), NULL, NULL,
			      g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	signals[DISCONNECTED] =
		g_signal_new ("disconnected",
			      G_TYPE_FROM_CLASS (object_class),
			      G_SIGNAL_RUN_LAST,
			      G_STRUCT_OFFSET (DMAPConnectionClass,
					       disconnected), NULL, NULL,
			      g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	signals[OPERATION_DONE] =
		g_signal_new ("operation-done",
			      G_TYPE_FROM_CLASS (object_class),
			      G_SIGNAL_RUN_FIRST,
			      G_STRUCT_OFFSET (DMAPConnectionClass,
					       operation_done), NULL, NULL,
			      g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}
Esempio n. 6
0
static void
gst_aravis_class_init (GstAravisClass * klass)
{
    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
    GstBaseSrcClass *gstbasesrc_class = GST_BASE_SRC_CLASS (klass);
    GstPushSrcClass *gstpushsrc_class = GST_PUSH_SRC_CLASS (klass);

    gobject_class->finalize = gst_aravis_finalize;
    gobject_class->set_property = gst_aravis_set_property;
    gobject_class->get_property = gst_aravis_get_property;

    g_object_class_install_property
    (gobject_class,
     PROP_CAMERA_NAME,
     g_param_spec_string ("camera-name",
                          "Camera name",
                          "Name of the camera",
                          NULL,
                          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property
    (gobject_class,
     PROP_GAIN,
     g_param_spec_int ("gain",
                       "Gain",
                       "Gain (dB)",
                       0, 500, 0,
                       G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property
    (gobject_class,
     PROP_EXPOSURE,
     g_param_spec_double ("exposure",
                          "Exposure",
                          "Exposure time (µs)",
                          0.0, 100000000.0, 500.0,
                          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property
    (gobject_class,
     PROP_H_BINNING,
     g_param_spec_int ("h-binning",
                       "Horizontal binning",
                       "CCD horizontal binning",
                       1, G_MAXINT, 1,
                       G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property
    (gobject_class,
     PROP_V_BINNING,
     g_param_spec_int ("v-binning",
                       "Vertical binning",
                       "CCD vertical binning",
                       1, G_MAXINT, 1,
                       G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

    GST_DEBUG_CATEGORY_INIT (aravis_debug, "aravissrc", 0, "Aravis interface");

    gstbasesrc_class->get_caps = gst_aravis_get_caps;
    gstbasesrc_class->set_caps = gst_aravis_set_caps;
    gstbasesrc_class->start = gst_aravis_start;
    gstbasesrc_class->stop = gst_aravis_stop;

    gstbasesrc_class->get_times = gst_aravis_get_times;

    gstpushsrc_class->create = gst_aravis_create;
}
Esempio n. 7
0
static void gwd_settings_interface_default_init (GWDSettingsInterface *settings_interface)
{
    g_object_interface_install_property (settings_interface,
					 g_param_spec_pointer ("active-shadow",
							       "Active Shadow",
							       "Active Shadow Settings",
							       G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_pointer ("inactive-shadow",
							       "Inactive Shadow",
							       "Inactive Shadow",
							       G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_boolean ("use-tooltips",
							       "Use Tooltips",
							       "Use Tooltips Setting",
							       USE_TOOLTIPS_DEFAULT,
							       G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_int ("draggable-border-width",
							   "Draggable Border Width",
							   "Draggable Border Width Setting",
							   0,
							   64,
							   DRAGGABLE_BORDER_WIDTH_DEFAULT,
							   G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_boolean ("attach-modal-dialogs",
							       "Attach modal dialogs",
							       "Attach modal dialogs setting",
							       ATTACH_MODAL_DIALOGS_DEFAULT,
							       G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_int ("blur",
							   "Blur Type",
							   "Blur type property",
							   BLUR_TYPE_NONE,
							   BLUR_TYPE_ALL,
							   BLUR_TYPE_NONE,
							   G_PARAM_READABLE |
							   G_PARAM_WRITABLE |
							   G_PARAM_CONSTRUCT_ONLY));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_string ("metacity-theme",
							      "Metacity Theme",
							      "Metacity Theme Setting",
							      METACITY_THEME_DEFAULT,
							      G_PARAM_READABLE |
							      G_PARAM_WRITABLE |
							      G_PARAM_CONSTRUCT_ONLY));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_double ("metacity-active-opacity",
							      "Metacity Active Opacity",
							      "Metacity Active Opacity",
							      0.0,
							      1.0,
							      METACITY_ACTIVE_OPACITY_DEFAULT,
							      G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_double ("metacity-inactive-opacity",
							      "Metacity Inactive Opacity",
							      "Metacity Inactive Opacity",
							      0.0,
							      1.0,
							      METACITY_INACTIVE_OPACITY_DEFAULT,
							      G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_boolean ("metacity-active-shade-opacity",
							      "Metacity Active Shade Opacity",
							      "Metacity Active Shade Opacity",
							      METACITY_ACTIVE_SHADE_OPACITY_DEFAULT,
							      G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_boolean ("metacity-inactive-shade-opacity",
							      "Metacity Inactive Shade Opacity",
							      "Metacity Inactive Shade Opacity",
							      METACITY_INACTIVE_SHADE_OPACITY_DEFAULT,
							      G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_string ("metacity-button-layout",
							      "Metacity Button Layout",
							      "Metacity Button Layout",
							      METACITY_BUTTON_LAYOUT_DEFAULT,
							      G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_int ("titlebar-double-click-action",
							   "Titlebar Action Double Click",
							   "Titlebar Action Double Click",
							   CLICK_ACTION_NONE,
							   CLICK_ACTION_MENU,
							   CLICK_ACTION_MAXIMIZE,
							   G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_int ("titlebar-middle-click-action",
							   "Titlebar Action Middle Click",
							   "Titlebar Action Middle Click",
							   CLICK_ACTION_NONE,
							   CLICK_ACTION_MENU,
							   CLICK_ACTION_LOWER,
							   G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_int ("titlebar-right-click-action",
							   "Titlebar Action Right Click",
							   "Titlebar Action Right Click",
							   CLICK_ACTION_NONE,
							   CLICK_ACTION_MENU,
							   CLICK_ACTION_MENU,
							   G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_int ("mouse-wheel-action",
							   "Mouse Wheel Action",
							   "Mouse Wheel Action",
							   WHEEL_ACTION_NONE,
							   WHEEL_ACTION_SHADE,
							   WHEEL_ACTION_SHADE,
							   G_PARAM_READABLE));
    g_object_interface_install_property (settings_interface,
					 g_param_spec_string ("titlebar-font",
							      "Titlebar Font",
							      "Titlebar Font",
							      TITLEBAR_FONT_DEFAULT,
							      G_PARAM_READABLE));
}
Esempio n. 8
0
/* initialize the cvsmooth's class */
static void
gst_cv_smooth_class_init (GstCvSmoothClass * klass)
{
  GObjectClass *gobject_class;
  GstOpencvBaseTransformClass *gstopencvbasefilter_class;
  GstElementClass *gstelement_class;
  GstCaps * caps;
  GstPadTemplate * templ;

  gobject_class = (GObjectClass *) klass;
  gstelement_class = (GstElementClass *) klass;
  gstopencvbasefilter_class = (GstOpencvBaseTransformClass *) klass;

  parent_class = g_type_class_peek_parent (klass);

  gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_cv_smooth_finalize);
  gobject_class->set_property = gst_cv_smooth_set_property;
  gobject_class->get_property = gst_cv_smooth_get_property;

  /* add sink and source pad templates */
  caps = gst_opencv_caps_from_cv_image_type (CV_8UC1);
  gst_caps_append (caps, gst_opencv_caps_from_cv_image_type (CV_8UC3));
  templ = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
      gst_caps_ref (caps));
  gst_element_class_add_pad_template (gstelement_class, templ);
  templ = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, caps);
  gst_element_class_add_pad_template (gstelement_class, templ);

  gstopencvbasefilter_class->cv_trans_ip_func = gst_cv_smooth_transform_ip;
  gstopencvbasefilter_class->cv_trans_func = gst_cv_smooth_transform;

  g_object_class_install_property (gobject_class, PROP_SMOOTH_TYPE,
      g_param_spec_enum ("type",
          "type",
          "Smooth Type",
          GST_TYPE_CV_SMOOTH_TYPE,
          DEFAULT_CV_SMOOTH_TYPE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
      );
  g_object_class_install_property (gobject_class, PROP_PARAM1,
      g_param_spec_int ("param1", "param1 (aperture width)",
          "The aperture width (Must be positive and odd)."
          "Check cvSmooth OpenCV docs: http://opencv.willowgarage.com"
          "/documentation/image_filtering.html#cvSmooth", 1, G_MAXINT,
          DEFAULT_PARAM1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, PROP_PARAM2,
      g_param_spec_int ("param2", "param2 (aperture height)",
          "The aperture height, if zero, the width is used."
          "(Must be positive and odd or zero, unuset in median and bilateral "
          "types). Check cvSmooth OpenCV docs: http://opencv.willowgarage.com"
          "/documentation/image_filtering.html#cvSmooth", 0, G_MAXINT,
          DEFAULT_PARAM2, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, PROP_PARAM3,
      g_param_spec_double ("param3", "param3 (gaussian standard deviation or "
          "color sigma",
          "If type is gaussian, this means the standard deviation."
          "If type is bilateral, this means the color-sigma. If zero, "
          "Default values are used."
          "Check cvSmooth OpenCV docs: http://opencv.willowgarage.com"
          "/documentation/image_filtering.html#cvSmooth",
          0, G_MAXDOUBLE, DEFAULT_PARAM3,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, PROP_PARAM4,
      g_param_spec_double ("param4", "param4 (spatial sigma, bilateral only)",
          "Only used in bilateral type, means the spatial-sigma."
          "Check cvSmooth OpenCV docs: http://opencv.willowgarage.com"
          "/documentation/image_filtering.html#cvSmooth",
          0, G_MAXDOUBLE, DEFAULT_PARAM4,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
Esempio n. 9
0
static void
clutter_alpha_class_init (ClutterAlphaClass *klass)
{
  GObjectClass *object_class = G_OBJECT_CLASS (klass);

  object_class->set_property = clutter_alpha_set_property;
  object_class->get_property = clutter_alpha_get_property;
  object_class->finalize     = clutter_alpha_finalize;
  object_class->dispose      = clutter_alpha_dispose;

  /**
   * ClutterAlpha:timeline:
   *
   * A #ClutterTimeline instance used to drive the alpha function.
   *
   * Since: 0.2
   *
   * Deprecated: 1.12
   */
  obj_props[PROP_TIMELINE] =
    g_param_spec_object ("timeline",
                               P_("Timeline"),
                               P_("Timeline used by the alpha"),
                               CLUTTER_TYPE_TIMELINE,
                               CLUTTER_PARAM_READWRITE);

  /**
   * ClutterAlpha:alpha:
   *
   * The alpha value as computed by the alpha function. The linear
   * interval is 0.0 to 1.0, but the Alpha allows overshooting by
   * one unit in each direction, so the valid interval is -1.0 to 2.0.
   *
   * Since: 0.2
   * Deprecated: 1.12
   */
  obj_props[PROP_ALPHA] =
    g_param_spec_double ("alpha",
                               P_("Alpha value"),
                               P_("Alpha value as computed by the alpha"),
                               -1.0, 2.0,
                               0.0,
                               CLUTTER_PARAM_READABLE);

  /**
   * ClutterAlpha:mode:
   *
   * The progress function logical id - either a value from the
   * #ClutterAnimationMode enumeration or a value returned by
   * clutter_alpha_register_func().
   *
   * If %CLUTTER_CUSTOM_MODE is used then the function set using
   * clutter_alpha_set_closure() or clutter_alpha_set_func()
   * will be used.
   *
   * Since: 1.0
   * Deprecated: 1.12
   */
  obj_props[PROP_MODE] =
    g_param_spec_ulong ("mode",
                              P_("Mode"),
                              P_("Progress mode"),
                              0, G_MAXULONG,
                              CLUTTER_CUSTOM_MODE,
                              G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE);

  g_object_class_install_properties (object_class,
                                     PROP_LAST,
                                     obj_props);
}
Esempio n. 10
0
void
register_image_select_procs (GimpPDB *pdb)
{
  GimpProcedure *procedure;

  /*
   * gimp-image-select-color
   */
  procedure = gimp_procedure_new (image_select_color_invoker);
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
                               "gimp-image-select-color");
  gimp_procedure_set_static_strings (procedure,
                                     "gimp-image-select-color",
                                     "Create a selection by selecting all pixels (in the specified drawable) with the same (or similar) color to that specified.",
                                     "This tool creates a selection over the specified image. A by-color selection is determined by the supplied color under the constraints of the current context settings. Essentially, all pixels (in the drawable) that have color sufficiently close to the specified color (as determined by the threshold and criterion context values) are included in the selection. To select transparent regions, the color specified must also have minimum alpha.\n"
                                     "\n"
                                     "This procedure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius', 'gimp-context-set-sample-merged', 'gimp-context-set-sample-criterion', 'gimp-context-set-sample-threshold', 'gimp-context-set-sample-transparent'.\n"
                                     "\n"
                                     "In the case of a merged sampling, the supplied drawable is ignored.",
                                     "David Gowers",
                                     "David Gowers",
                                     "2010",
                                     NULL);
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_image_id ("image",
                                                         "image",
                                                         "The affected image",
                                                         pdb->gimp, FALSE,
                                                         GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_enum ("operation",
                                                  "operation",
                                                  "The selection operation",
                                                  GIMP_TYPE_CHANNEL_OPS,
                                                  GIMP_CHANNEL_OP_ADD,
                                                  GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_drawable_id ("drawable",
                                                            "drawable",
                                                            "The affected drawable",
                                                            pdb->gimp, FALSE,
                                                            GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_rgb ("color",
                                                    "color",
                                                    "The color to select",
                                                    FALSE,
                                                    NULL,
                                                    GIMP_PARAM_READWRITE));
  gimp_pdb_register_procedure (pdb, procedure);
  g_object_unref (procedure);

  /*
   * gimp-image-select-contiguous-color
   */
  procedure = gimp_procedure_new (image_select_contiguous_color_invoker);
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
                               "gimp-image-select-contiguous-color");
  gimp_procedure_set_static_strings (procedure,
                                     "gimp-image-select-contiguous-color",
                                     "Create a selection by selecting all pixels around specified coordinates with the same (or similar) color to that at the coordinates.",
                                     "This tool creates a contiguous selection over the specified image. A contiguous color selection is determined by a seed fill under the constraints of the current context settings. Essentially, the color at the specified coordinates (in the drawable) is measured and the selection expands outwards from that point to any adjacent pixels which are not significantly different (as determined by the threshold and criterion context settings). This process continues until no more expansion is possible. If antialiasing is turned on, the final selection mask will contain intermediate values based on close misses to the threshold bar at pixels along the seed fill boundary.\n"
                                     "\n"
                                     "This procedure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius', 'gimp-context-set-sample-merged', 'gimp-context-set-sample-criterion', 'gimp-context-set-sample-threshold', 'gimp-context-set-sample-transparent', 'gimp-context-set-diagonal-neighbors'.\n"
                                     "\n"
                                     "In the case of a merged sampling, the supplied drawable is ignored. If the sample is merged, the specified coordinates are relative to the image origin; otherwise, they are relative to the drawable's origin.",
                                     "David Gowers",
                                     "David Gowers",
                                     "2010",
                                     NULL);
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_image_id ("image",
                                                         "image",
                                                         "The affected image",
                                                         pdb->gimp, FALSE,
                                                         GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_enum ("operation",
                                                  "operation",
                                                  "The selection operation",
                                                  GIMP_TYPE_CHANNEL_OPS,
                                                  GIMP_CHANNEL_OP_ADD,
                                                  GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_drawable_id ("drawable",
                                                            "drawable",
                                                            "The affected drawable",
                                                            pdb->gimp, FALSE,
                                                            GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("x",
                                                    "x",
                                                    "x coordinate of initial seed fill point: (image coordinates)",
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("y",
                                                    "y",
                                                    "y coordinate of initial seed fill point: (image coordinates)",
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_pdb_register_procedure (pdb, procedure);
  g_object_unref (procedure);

  /*
   * gimp-image-select-rectangle
   */
  procedure = gimp_procedure_new (image_select_rectangle_invoker);
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
                               "gimp-image-select-rectangle");
  gimp_procedure_set_static_strings (procedure,
                                     "gimp-image-select-rectangle",
                                     "Create a rectangular selection over the specified image;",
                                     "This tool creates a rectangular selection over the specified image. The rectangular region can be either added to, subtracted from, or replace the contents of the previous selection mask.\n"
                                     "\n"
                                     "This procedure is affected by the following context setters: 'gimp-context-set-feather', 'gimp-context-set-feather-radius'.",
                                     "Michael Natterer <*****@*****.**>",
                                     "Michael Natterer",
                                     "2010",
                                     NULL);
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_image_id ("image",
                                                         "image",
                                                         "The image",
                                                         pdb->gimp, FALSE,
                                                         GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_enum ("operation",
                                                  "operation",
                                                  "The selection operation",
                                                  GIMP_TYPE_CHANNEL_OPS,
                                                  GIMP_CHANNEL_OP_ADD,
                                                  GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("x",
                                                    "x",
                                                    "x coordinate of upper-left corner of rectangle",
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("y",
                                                    "y",
                                                    "y coordinate of upper-left corner of rectangle",
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("width",
                                                    "width",
                                                    "The width of the rectangle",
                                                    0, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("height",
                                                    "height",
                                                    "The height of the rectangle",
                                                    0, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_pdb_register_procedure (pdb, procedure);
  g_object_unref (procedure);

  /*
   * gimp-image-select-round-rectangle
   */
  procedure = gimp_procedure_new (image_select_round_rectangle_invoker);
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
                               "gimp-image-select-round-rectangle");
  gimp_procedure_set_static_strings (procedure,
                                     "gimp-image-select-round-rectangle",
                                     "Create a rectangular selection with round corners over the specified image;",
                                     "This tool creates a rectangular selection with round corners over the specified image. The rectangular region can be either added to, subtracted from, or replace the contents of the previous selection mask.\n"
                                     "\n"
                                     "This procedure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius'.",
                                     "Martin Nordholts",
                                     "Martin Nordholts",
                                     "2010",
                                     NULL);
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_image_id ("image",
                                                         "image",
                                                         "The image",
                                                         pdb->gimp, FALSE,
                                                         GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_enum ("operation",
                                                  "operation",
                                                  "The selection operation",
                                                  GIMP_TYPE_CHANNEL_OPS,
                                                  GIMP_CHANNEL_OP_ADD,
                                                  GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("x",
                                                    "x",
                                                    "x coordinate of upper-left corner of rectangle",
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("y",
                                                    "y",
                                                    "y coordinate of upper-left corner of rectangle",
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("width",
                                                    "width",
                                                    "The width of the rectangle",
                                                    0, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("height",
                                                    "height",
                                                    "The height of the rectangle",
                                                    0, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("corner-radius-x",
                                                    "corner radius x",
                                                    "The corner radius in X direction",
                                                    0, GIMP_MAX_IMAGE_SIZE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("corner-radius-y",
                                                    "corner radius y",
                                                    "The corner radius in Y direction",
                                                    0, GIMP_MAX_IMAGE_SIZE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_pdb_register_procedure (pdb, procedure);
  g_object_unref (procedure);

  /*
   * gimp-image-select-ellipse
   */
  procedure = gimp_procedure_new (image_select_ellipse_invoker);
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
                               "gimp-image-select-ellipse");
  gimp_procedure_set_static_strings (procedure,
                                     "gimp-image-select-ellipse",
                                     "Create an elliptical selection over the specified image.",
                                     "This tool creates an elliptical selection over the specified image. The elliptical region can be either added to, subtracted from, or replace the contents of the previous selection mask.\n"
                                     "\n"
                                     "This procedure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius'.",
                                     "Michael Natterer <*****@*****.**>",
                                     "Michael Natterer",
                                     "2010",
                                     NULL);
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_image_id ("image",
                                                         "image",
                                                         "The image",
                                                         pdb->gimp, FALSE,
                                                         GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_enum ("operation",
                                                  "operation",
                                                  "The selection operation",
                                                  GIMP_TYPE_CHANNEL_OPS,
                                                  GIMP_CHANNEL_OP_ADD,
                                                  GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("x",
                                                    "x",
                                                    "x coordinate of upper-left corner of ellipse bounding box",
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("y",
                                                    "y",
                                                    "y coordinate of upper-left corner of ellipse bounding box",
                                                    -G_MAXDOUBLE, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("width",
                                                    "width",
                                                    "The width of the ellipse",
                                                    0, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_double ("height",
                                                    "height",
                                                    "The height of the ellipse",
                                                    0, G_MAXDOUBLE, 0,
                                                    GIMP_PARAM_READWRITE));
  gimp_pdb_register_procedure (pdb, procedure);
  g_object_unref (procedure);

  /*
   * gimp-image-select-polygon
   */
  procedure = gimp_procedure_new (image_select_polygon_invoker);
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
                               "gimp-image-select-polygon");
  gimp_procedure_set_static_strings (procedure,
                                     "gimp-image-select-polygon",
                                     "Create a polygonal selection over the specified image.",
                                     "This tool creates a polygonal selection over the specified image. The polygonal region can be either added to, subtracted from, or replace the contents of the previous selection mask. The polygon is specified through an array of floating point numbers and its length. The length of array must be 2n, where n is the number of points. Each point is defined by 2 floating point values which correspond to the x and y coordinates. If the final point does not connect to the starting point, a connecting segment is automatically added.\n"
                                     "\n"
                                     "This procedure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius'.",
                                     "Michael Natterer <*****@*****.**>",
                                     "Michael Natterer",
                                     "2010",
                                     NULL);
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_image_id ("image",
                                                         "image",
                                                         "The image",
                                                         pdb->gimp, FALSE,
                                                         GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_enum ("operation",
                                                  "operation",
                                                  "The selection operation",
                                                  GIMP_TYPE_CHANNEL_OPS,
                                                  GIMP_CHANNEL_OP_ADD,
                                                  GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_int32 ("num-segs",
                                                      "num segs",
                                                      "Number of points (count 1 coordinate as two points)",
                                                      2, G_MAXINT32, 2,
                                                      GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_float_array ("segs",
                                                            "segs",
                                                            "Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}",
                                                            GIMP_PARAM_READWRITE));
  gimp_pdb_register_procedure (pdb, procedure);
  g_object_unref (procedure);

  /*
   * gimp-image-select-item
   */
  procedure = gimp_procedure_new (image_select_item_invoker);
  gimp_object_set_static_name (GIMP_OBJECT (procedure),
                               "gimp-image-select-item");
  gimp_procedure_set_static_strings (procedure,
                                     "gimp-image-select-item",
                                     "Transforms the specified item into a selection",
                                     "This procedure renders the item's outline into the current selection of the image the item belongs to. What exactly the item's outline is depends on the item type: for layers, it's the layer's alpha channel, for vectors the vector's shape.\n"
                                     "\n"
                                     "This procedure is affected by the following context setters: 'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius'.",
                                     "Michael Natterer <*****@*****.**>",
                                     "Michael Natterer",
                                     "2010",
                                     NULL);
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_image_id ("image",
                                                         "image",
                                                         "The image",
                                                         pdb->gimp, FALSE,
                                                         GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               g_param_spec_enum ("operation",
                                                  "operation",
                                                  "The desired operation with current selection",
                                                  GIMP_TYPE_CHANNEL_OPS,
                                                  GIMP_CHANNEL_OP_ADD,
                                                  GIMP_PARAM_READWRITE));
  gimp_procedure_add_argument (procedure,
                               gimp_param_spec_item_id ("item",
                                                        "item",
                                                        "The item to render to the selection",
                                                        pdb->gimp, FALSE,
                                                        GIMP_PARAM_READWRITE));
  gimp_pdb_register_procedure (pdb, procedure);
  g_object_unref (procedure);
}
Esempio n. 11
0
static void
gimp_filter_options_class_init (GimpFilterOptionsClass *klass)
{
  GObjectClass *object_class = G_OBJECT_CLASS (klass);

  object_class->finalize     = gimp_filter_options_finalize;
  object_class->set_property = gimp_filter_options_set_property;
  object_class->get_property = gimp_filter_options_get_property;

  GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_PREVIEW,
                            "preview",
                            _("_Preview"),
                            NULL,
                            TRUE,
                            GIMP_PARAM_STATIC_STRINGS);

  g_object_class_install_property (object_class, PROP_PREVIEW_SPLIT,
                                   g_param_spec_boolean ("preview-split",
                                                         _("_Split view"),
                                                         NULL,
                                                         FALSE,
                                                         GIMP_PARAM_READWRITE |
                                                         G_PARAM_CONSTRUCT));

  g_object_class_install_property (object_class, PROP_PREVIEW_ALIGNMENT,
                                   g_param_spec_enum ("preview-alignment",
                                                      NULL, NULL,
                                                      GIMP_TYPE_ALIGNMENT_TYPE,
                                                      GIMP_ALIGN_LEFT,
                                                      GIMP_PARAM_READWRITE |
                                                      G_PARAM_CONSTRUCT));

  g_object_class_install_property (object_class, PROP_PREVIEW_POSITION,
                                   g_param_spec_double ("preview-position",
                                                        NULL, NULL,
                                                        0.0, 1.0, 0.5,
                                                        GIMP_PARAM_READWRITE |
                                                        G_PARAM_CONSTRUCT));

  g_object_class_install_property (object_class, PROP_REGION,
                                   g_param_spec_enum ("region",
                                                      NULL, NULL,
                                                      GIMP_TYPE_FILTER_REGION,
                                                      GIMP_FILTER_REGION_SELECTION,
                                                      GIMP_PARAM_READWRITE |
                                                      G_PARAM_CONSTRUCT));

  g_object_class_install_property (object_class, PROP_COLOR_MANAGED,
                                   g_param_spec_boolean ("color-managed",
                                                         _("Color _managed"),
                                                         NULL,
                                                         FALSE,
                                                         GIMP_PARAM_READWRITE |
                                                         G_PARAM_CONSTRUCT));

  g_object_class_install_property (object_class, PROP_GAMMA_HACK,
                                   g_param_spec_boolean ("gamma-hack",
                                                         "Gamma hack (temp hack, please ignore)",
                                                         NULL,
                                                         FALSE,
                                                         GIMP_PARAM_READWRITE |
                                                         G_PARAM_CONSTRUCT));

  g_object_class_install_property (object_class, PROP_SETTINGS,
                                   g_param_spec_object ("settings",
                                                        NULL, NULL,
                                                        G_TYPE_FILE,
                                                        GIMP_PARAM_READWRITE));
}
Esempio n. 12
0
/* initialize the facedetect's class */
static void
gst_face_detect_class_init (GstFaceDetectClass * klass)
{
    GObjectClass *gobject_class;
    GstOpencvVideoFilterClass *gstopencvbasefilter_class;

    GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
    gobject_class = (GObjectClass *) klass;
    gstopencvbasefilter_class = (GstOpencvVideoFilterClass *) klass;

    gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_face_detect_finalize);
    gobject_class->set_property = gst_face_detect_set_property;
    gobject_class->get_property = gst_face_detect_get_property;

    gstopencvbasefilter_class->cv_trans_ip_func = gst_face_detect_transform_ip;
    gstopencvbasefilter_class->cv_set_caps = gst_face_detect_set_caps;

    g_object_class_install_property (gobject_class, PROP_DISPLAY,
                                     g_param_spec_boolean ("display", "Display",
                                             "Sets whether the detected faces should be highlighted in the output",
                                             TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

    g_object_class_install_property (gobject_class, PROP_FACE_PROFILE,
                                     g_param_spec_string ("profile", "Face profile",
                                             "Location of Haar cascade file to use for face detection",
                                             DEFAULT_FACE_PROFILE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_NOSE_PROFILE,
                                     g_param_spec_string ("nose-profile", "Nose profile",
                                             "Location of Haar cascade file to use for nose detection",
                                             DEFAULT_NOSE_PROFILE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_MOUTH_PROFILE,
                                     g_param_spec_string ("mouth-profile", "Mouth profile",
                                             "Location of Haar cascade file to use for mouth detection",
                                             DEFAULT_MOUTH_PROFILE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_EYES_PROFILE,
                                     g_param_spec_string ("eyes-profile", "Eyes profile",
                                             "Location of Haar cascade file to use for eye-pair detection",
                                             DEFAULT_EYES_PROFILE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

    g_object_class_install_property (gobject_class, PROP_FLAGS,
                                     g_param_spec_flags ("flags", "Flags", "Flags to cvHaarDetectObjects",
                                             GST_TYPE_OPENCV_FACE_DETECT_FLAGS, DEFAULT_FLAGS,
                                             G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_SCALE_FACTOR,
                                     g_param_spec_double ("scale-factor", "Scale factor",
                                             "Factor by which the frame is scaled after each object scan",
                                             1.1, 10.0, DEFAULT_SCALE_FACTOR,
                                             G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_MIN_NEIGHBORS,
                                     g_param_spec_int ("min-neighbors", "Mininum neighbors",
                                             "Minimum number (minus 1) of neighbor rectangles that makes up "
                                             "an object", 0, G_MAXINT, DEFAULT_MIN_NEIGHBORS,
                                             G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_MIN_SIZE_WIDTH,
                                     g_param_spec_int ("min-size-width", "Minimum face width",
                                             "Minimum area width to be recognized as a face", 0, G_MAXINT,
                                             DEFAULT_MIN_SIZE_WIDTH, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_MIN_SIZE_HEIGHT,
                                     g_param_spec_int ("min-size-height", "Minimum face height",
                                             "Minimum area height to be recognized as a face", 0, G_MAXINT,
                                             DEFAULT_MIN_SIZE_HEIGHT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_UPDATES,
                                     g_param_spec_enum ("updates", "Updates",
                                             "When send update bus messages, if at all",
                                             GST_TYPE_FACE_DETECT_UPDATES, GST_FACEDETECT_UPDATES_EVERY_FRAME,
                                             G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
    g_object_class_install_property (gobject_class, PROP_MIN_STDDEV,
                                     g_param_spec_int ("min-stddev", "Minimum image standard deviation",
                                             "Minimum image average standard deviation: on images with standard "
                                             "deviation lesser than this value facedetection will not be "
                                             "performed. Setting this property help to save cpu and reduce "
                                             "false positives not performing face detection on images with "
                                             "little changes", 0,
                                             255, DEFAULT_MIN_STDDEV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

    gst_element_class_set_static_metadata (element_class,
                                           "facedetect",
                                           "Filter/Effect/Video",
                                           "Performs face detection on videos and images, providing detected positions via bus messages",
                                           "Michael Sheldon <*****@*****.**>");

    gst_element_class_add_pad_template (element_class,
                                        gst_static_pad_template_get (&src_factory));
    gst_element_class_add_pad_template (element_class,
                                        gst_static_pad_template_get (&sink_factory));
}
Esempio n. 13
0
static void
clutter_behaviour_ellipse_class_init (ClutterBehaviourEllipseClass *klass)
{
  GObjectClass          *object_class = G_OBJECT_CLASS (klass);
  ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass);
  GParamSpec            *pspec        = NULL;

  g_type_class_add_private (klass, sizeof (ClutterBehaviourEllipsePrivate));

  object_class->set_property = clutter_behaviour_ellipse_set_property;
  object_class->get_property = clutter_behaviour_ellipse_get_property;

  behave_class->alpha_notify = clutter_behaviour_ellipse_alpha_notify;
  behave_class->applied = clutter_behaviour_ellipse_applied;

  /**
   * ClutterBehaviourEllipse:angle-start:
   *
   * The initial angle from where the rotation should start.
   *
   * Since: 0.4
   */
  pspec = g_param_spec_double ("angle-start",
                               P_("Start Angle"),
                               P_("Initial angle"),
                               0.0, 360.0,
                               0.0,
                               CLUTTER_PARAM_READWRITE);
  obj_props[PROP_ANGLE_START] = pspec;
  g_object_class_install_property (object_class, PROP_ANGLE_START, pspec);

  /**
   * ClutterBehaviourEllipse:angle-end:
   *
   * The final angle to where the rotation should end.
   *
   * Since: 0.4
   */
  pspec = g_param_spec_double ("angle-end",
                               P_("End Angle"),
                               P_("Final angle"),
                               0.0, 360.0,
                               0.0,
                               CLUTTER_PARAM_READWRITE);
  obj_props[PROP_ANGLE_END] = pspec;
  g_object_class_install_property (object_class, PROP_ANGLE_END, pspec);

  /**
   * ClutterBehaviourEllipse:angle-tilt-x:
   *
   * The tilt angle for the rotation around center in X axis
   *
   * Since: 0.4
   */
  pspec = g_param_spec_double ("angle-tilt-x",
                               P_("Angle x tilt"),
                               P_("Tilt of the ellipse around x axis"),
                               0.0, 360.0,
                               360.0,
                               CLUTTER_PARAM_READWRITE);
  obj_props[PROP_ANGLE_TILT_X] = pspec;
  g_object_class_install_property (object_class, PROP_ANGLE_TILT_X, pspec);

  /**
   * ClutterBehaviourEllipse:angle-tilt-y:
   *
   * The tilt angle for the rotation around center in Y axis
   *
   * Since: 0.4
   */
  pspec = g_param_spec_double ("angle-tilt-y",
                               P_("Angle y tilt"),
                               P_("Tilt of the ellipse around y axis"),
                               0.0, 360.0,
                               360.0,
                               CLUTTER_PARAM_READWRITE);
  obj_props[PROP_ANGLE_TILT_Y] = pspec;
  g_object_class_install_property (object_class, PROP_ANGLE_TILT_Y, pspec);

  /**
   * ClutterBehaviourEllipse:angle-tilt-z:
   *
   * The tilt angle for the rotation on the Z axis
   *
   * Since: 0.4
   */
  pspec = g_param_spec_double ("angle-tilt-z",
                               P_("Angle z tilt"),
                               P_("Tilt of the ellipse around z axis"),
                               0.0, 360.0,
                               360.0,
                               CLUTTER_PARAM_READWRITE);
  obj_props[PROP_ANGLE_TILT_Z] = pspec;
  g_object_class_install_property (object_class, PROP_ANGLE_TILT_Z, pspec);

  /**
   * ClutterBehaviourEllipse:width:
   *
   * Width of the ellipse, in pixels
   *
   * Since: 0.4
   */
  pspec = g_param_spec_int ("width",
                            P_("Width"),
                            P_("Width of the ellipse"),
                            0, G_MAXINT,
                            100,
                            CLUTTER_PARAM_READWRITE);
  obj_props[PROP_WIDTH] = pspec;
  g_object_class_install_property (object_class, PROP_WIDTH, pspec);

  /**
   * ClutterBehaviourEllipse:height:
   *
   * Height of the ellipse, in pixels
   *
   * Since: 0.4
   */
  pspec = g_param_spec_int ("height",
                            P_("Height"),
                            P_("Height of ellipse"),
                            0, G_MAXINT,
                            50,
                            CLUTTER_PARAM_READWRITE);
  obj_props[PROP_HEIGHT] = pspec;
  g_object_class_install_property (object_class, PROP_HEIGHT, pspec);

  /**
   * ClutterBehaviourEllipse:center:
   *
   * The center of the ellipse.
   *
   * Since: 0.4
   */
  pspec = g_param_spec_boxed ("center",
                              P_("Center"),
                              P_("Center of ellipse"),
                              CLUTTER_TYPE_KNOT,
                              CLUTTER_PARAM_READWRITE);
  obj_props[PROP_CENTER] = pspec;
  g_object_class_install_property (object_class, PROP_CENTER, pspec);

  /**
   * ClutterBehaviourEllipse:direction:
   *
   * The direction of the rotation.
   *
   * Since: 0.4
   */
  pspec = g_param_spec_enum ("direction",
                             P_("Direction"),
                             P_("Direction of rotation"),
                             CLUTTER_TYPE_ROTATE_DIRECTION,
                             CLUTTER_ROTATE_CW,
                             CLUTTER_PARAM_READWRITE);
  obj_props[PROP_DIRECTION] = pspec;
  g_object_class_install_property (object_class, PROP_DIRECTION, pspec);
}
Esempio n. 14
0
static void
cheese_gconf_class_init (CheeseGConfClass *klass)
{
  GObjectClass *object_class = G_OBJECT_CLASS (klass);

  object_class->finalize = cheese_gconf_finalize;

  object_class->get_property = cheese_gconf_get_property;
  object_class->set_property = cheese_gconf_set_property;

  g_object_class_install_property (object_class, GCONF_PROP_COUNTDOWN,
                                   g_param_spec_boolean ("gconf_prop_countdown",
                                                         NULL,
                                                         NULL,
                                                         FALSE,
                                                         G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_FLASH,
                                   g_param_spec_boolean ("gconf_prop_flash",
                                                         NULL,
                                                         NULL,
                                                         TRUE,
                                                         G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_CAMERA,
                                   g_param_spec_string ("gconf_prop_camera",
                                                        NULL,
                                                        NULL,
                                                        "",
                                                        G_PARAM_READWRITE));
  g_object_class_install_property (object_class, GCONF_PROP_SELECTED_EFFECTS,
                                   g_param_spec_string ("gconf_prop_selected_effects",
                                                        NULL,
                                                        NULL,
                                                        "",
                                                        G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_X_RESOLUTION,
                                   g_param_spec_int ("gconf_prop_x_resolution",
                                                     NULL,
                                                     NULL,
                                                     0,
                                                     G_MAXINT,
                                                     0,
                                                     G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_Y_RESOLUTION,
                                   g_param_spec_int ("gconf_prop_y_resolution",
                                                     NULL,
                                                     NULL,
                                                     0,
                                                     G_MAXINT,
                                                     0,
                                                     G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_BRIGHTNESS,
                                   g_param_spec_double ("gconf_prop_brightness",
                                                        NULL,
                                                        NULL,
                                                        -G_MAXFLOAT,
                                                        G_MAXFLOAT,
                                                        0.0,
                                                        G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_CONTRAST,
                                   g_param_spec_double ("gconf_prop_contrast",
                                                        NULL,
                                                        NULL,
                                                        0,
                                                        G_MAXFLOAT,
                                                        1.0,
                                                        G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_SATURATION,
                                   g_param_spec_double ("gconf_prop_saturation",
                                                        NULL,
                                                        NULL,
                                                        0,
                                                        G_MAXFLOAT,
                                                        1.0,
                                                        G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_HUE,
                                   g_param_spec_double ("gconf_prop_hue",
                                                        NULL,
                                                        NULL,
                                                        -G_MAXFLOAT,
                                                        G_MAXFLOAT,
                                                        0.0,
                                                        G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_VIDEO_PATH,
                                   g_param_spec_string ("gconf_prop_video_path",
                                                        NULL,
                                                        NULL,
                                                        "",
                                                        G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_PHOTO_PATH,
                                   g_param_spec_string ("gconf_prop_photo_path",
                                                        NULL,
                                                        NULL,
                                                        "",
                                                        G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_ENABLE_DELETE,
                                   g_param_spec_boolean ("gconf_prop_enable_delete",
                                                         NULL,
                                                         NULL,
                                                         FALSE,
                                                         G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_WIDE_MODE,
                                   g_param_spec_boolean ("gconf_prop_wide_mode",
                                                         NULL,
                                                         NULL,
                                                         FALSE,
                                                         G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_BURST_DELAY,
                                   g_param_spec_int ("gconf_prop_burst_delay",
                                                     NULL,
                                                     NULL,
                                                     200,  /* based on some experiments */
                                                     G_MAXINT,
                                                     1000,
                                                     G_PARAM_READWRITE));

  g_object_class_install_property (object_class, GCONF_PROP_BURST_REPEAT,
                                   g_param_spec_int ("gconf_prop_burst_repeat",
                                                     NULL,
                                                     NULL,
                                                     1,
                                                     G_MAXINT,
                                                     4,
                                                     G_PARAM_READWRITE));

  g_type_class_add_private (klass, sizeof (CheeseGConfPrivate));
}
Esempio n. 15
0
static void qcad_rectangle_electrode_class_init (GObjectClass *klass, gpointer data)
  {
#ifdef PROPERTY_UIS
  // Gotta be static so the strings don't die
  static QCADPropertyUIProperty properties[] =
    {
    {NULL,     "title",     {0, }},
    {"width",  "units",     {0, }},
    {"height", "units",     {0, }},
    {"angle",  "units",     {0, }},
    } ;

  // RectangleElectrode.title = "QCA Rectangular Electrode"
  g_value_set_string (g_value_init (&(properties[0].ui_property_value), G_TYPE_STRING), _("QCA Rectangular Electrode")) ;
  // RectangleElectrode.width.units = "nm"
  g_value_set_string (g_value_init (&(properties[1].ui_property_value), G_TYPE_STRING), "nm") ;
  // RectangleElectrode.height.units = "nm"
  g_value_set_string (g_value_init (&(properties[2].ui_property_value), G_TYPE_STRING), "nm") ;
  // RectangleElectrode.angle.units = "°"
  g_value_set_string (g_value_init (&(properties[3].ui_property_value), G_TYPE_STRING), "°") ;

  qcad_object_class_install_ui_properties (QCAD_OBJECT_CLASS (klass), properties, G_N_ELEMENTS (properties)) ;
#endif /* def PROPERTY_UIS */

  G_OBJECT_CLASS (klass)->finalize     = finalize ;
  G_OBJECT_CLASS (klass)->set_property = set_property ;
  G_OBJECT_CLASS (klass)->get_property = get_property ;
  QCAD_OBJECT_CLASS (klass)->copy                     = copy ;
  QCAD_OBJECT_CLASS (klass)->class_get_default_object = class_get_default_object ;
#ifdef GTK_GUI
  QCAD_DESIGN_OBJECT_CLASS (klass)->draw                       = draw ;
  QCAD_DESIGN_OBJECT_CLASS (klass)->mh.button_pressed          = (GCallback)button_pressed ;
#endif /* def GTK_GUI */
  QCAD_DESIGN_OBJECT_CLASS (klass)->PostScript_preamble        = PostScript_preamble ;
  QCAD_DESIGN_OBJECT_CLASS (klass)->PostScript_instance        = PostScript_instance ;
  QCAD_DESIGN_OBJECT_CLASS (klass)->move                       = move ;
  QCAD_DESIGN_OBJECT_CLASS (klass)->serialize                  = serialize ;
  QCAD_DESIGN_OBJECT_CLASS (klass)->unserialize                = unserialize ;

  //QCAD_ELECTRODE_CLASS (klass)->get_potential     = get_potential ;
  QCAD_ELECTRODE_CLASS (klass)->get_area          = get_area ;
	QCAD_ELECTRODE_CLASS (klass)->get_long_side     = get_long_side ;
	QCAD_ELECTRODE_CLASS (klass)->get_short_side    = get_short_side ;
  QCAD_ELECTRODE_CLASS (klass)->precompute        = precompute ;
  QCAD_ELECTRODE_CLASS (klass)->extreme_potential = extreme_potential ;

  g_object_class_install_property (G_OBJECT_CLASS (klass), QCAD_RECTANGLE_ELECTRODE_PROPERTY_CX,
    g_param_spec_double ("width", _("Electrode Width"), _("Electrode Width"),
      0.1, 1e9,  6.0, G_PARAM_READABLE | G_PARAM_WRITABLE)) ;

  g_object_class_install_property (G_OBJECT_CLASS (klass), QCAD_RECTANGLE_ELECTRODE_PROPERTY_CY,
    g_param_spec_double ("height", _("Electrode Height"), _("Electrode Height"),
      0.1, 1e9, 40.0, G_PARAM_READABLE | G_PARAM_WRITABLE)) ;

  g_object_class_install_property (G_OBJECT_CLASS (klass), QCAD_RECTANGLE_ELECTRODE_PROPERTY_X_DOTS,
    g_param_spec_uint ("x-dots", _("x Divisions"), _("Number of x divisions"),
      1, G_MAXUINT, 2, G_PARAM_READABLE | G_PARAM_WRITABLE)) ;

  g_object_class_install_property (G_OBJECT_CLASS (klass), QCAD_RECTANGLE_ELECTRODE_PROPERTY_Y_DOTS,
    g_param_spec_uint ("y-dots", _("y Divisions"), _("Number of y divisions"),
      1, G_MAXUINT, 10, G_PARAM_READABLE | G_PARAM_WRITABLE)) ;

  g_object_class_install_property (G_OBJECT_CLASS (klass), QCAD_RECTANGLE_ELECTRODE_PROPERTY_ANGLE,
    g_param_spec_double ("angle", _("Electrode Angle"), _("Electrode Angle"),
      0.0, 360, 0.0, G_PARAM_READABLE | G_PARAM_WRITABLE)) ;
  }
Esempio n. 16
0
  widget_class->get_preferred_width = gtk_progress_bar_get_preferred_width;
  widget_class->get_preferred_height = gtk_progress_bar_get_preferred_height;

  g_object_class_override_property (gobject_class, PROP_ORIENTATION, "orientation");

  progress_props[PROP_INVERTED] =
      g_param_spec_boolean ("inverted",
                            P_("Inverted"),
                            P_("Invert the direction in which the progress bar grows"),
                            FALSE,
                            GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);

  progress_props[PROP_FRACTION] =
      g_param_spec_double ("fraction",
                           P_("Fraction"),
                           P_("The fraction of total work that has been completed"),
                           0.0, 1.0,
                           0.0,
                           GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);

  progress_props[PROP_PULSE_STEP] =
      g_param_spec_double ("pulse-step",
                           P_("Pulse Step"),
                           P_("The fraction of total progress to move the bouncing block when pulsed"),
                           0.0, 1.0,
                           0.1,
                           GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);

  progress_props[PROP_TEXT] =
      g_param_spec_string ("text",
                           P_("Text"),
                           P_("Text to be displayed in the progress bar"),
Esempio n. 17
0
static void
gst_audio_test_src_class_init (GstAudioTestSrcClass * klass)
{
  GObjectClass *gobject_class;
  GstBaseSrcClass *gstbasesrc_class;

  gobject_class = (GObjectClass *) klass;
  gstbasesrc_class = (GstBaseSrcClass *) klass;

  gobject_class->set_property = gst_audio_test_src_set_property;
  gobject_class->get_property = gst_audio_test_src_get_property;
  gobject_class->finalize = gst_audio_test_src_finalize;

  g_object_class_install_property (gobject_class, PROP_SAMPLES_PER_BUFFER,
      g_param_spec_int ("samplesperbuffer", "Samples per buffer",
          "Number of samples in each outgoing buffer",
          1, G_MAXINT, DEFAULT_SAMPLES_PER_BUFFER,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, PROP_WAVE,
      g_param_spec_enum ("wave", "Waveform", "Oscillator waveform",
          GST_TYPE_AUDIO_TEST_SRC_WAVE, GST_AUDIO_TEST_SRC_WAVE_SINE,
          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, PROP_FREQ,
      g_param_spec_double ("freq", "Frequency", "Frequency of test signal",
          0.0, 20000.0, DEFAULT_FREQ,
          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, PROP_VOLUME,
      g_param_spec_double ("volume", "Volume", "Volume of test signal", 0.0,
          1.0, DEFAULT_VOLUME,
          G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, PROP_IS_LIVE,
      g_param_spec_boolean ("is-live", "Is Live",
          "Whether to act as a live source", DEFAULT_IS_LIVE,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (G_OBJECT_CLASS (klass),
      PROP_TIMESTAMP_OFFSET, g_param_spec_int64 ("timestamp-offset",
          "Timestamp offset",
          "An offset added to timestamps set on buffers (in ns)", G_MININT64,
          G_MAXINT64, DEFAULT_TIMESTAMP_OFFSET,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, PROP_CAN_ACTIVATE_PUSH,
      g_param_spec_boolean ("can-activate-push", "Can activate push",
          "Can activate in push mode", DEFAULT_CAN_ACTIVATE_PUSH,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, PROP_CAN_ACTIVATE_PULL,
      g_param_spec_boolean ("can-activate-pull", "Can activate pull",
          "Can activate in pull mode", DEFAULT_CAN_ACTIVATE_PULL,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  gstbasesrc_class->set_caps = GST_DEBUG_FUNCPTR (gst_audio_test_src_setcaps);
  gstbasesrc_class->is_seekable =
      GST_DEBUG_FUNCPTR (gst_audio_test_src_is_seekable);
  gstbasesrc_class->check_get_range =
      GST_DEBUG_FUNCPTR (gst_audio_test_src_check_get_range);
  gstbasesrc_class->do_seek = GST_DEBUG_FUNCPTR (gst_audio_test_src_do_seek);
  gstbasesrc_class->query = GST_DEBUG_FUNCPTR (gst_audio_test_src_query);
  gstbasesrc_class->get_times =
      GST_DEBUG_FUNCPTR (gst_audio_test_src_get_times);
  gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_audio_test_src_start);
  gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_audio_test_src_stop);
  gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_audio_test_src_create);
}
void gst_uade_raw_dec_class_init(GstUadeRawDecClass *klass)
{
	GObjectClass *object_class;
	GstElementClass *element_class;
	GstNonstreamAudioDecoderClass *dec_class;

	GST_DEBUG_CATEGORY_INIT(uaderawdec_debug, "uaderawdec", 0, "video game music player");

	object_class = G_OBJECT_CLASS(klass);
	element_class = GST_ELEMENT_CLASS(klass);
	dec_class = GST_NONSTREAM_AUDIO_DECODER_CLASS(klass);

	gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&src_template));

	object_class->finalize = GST_DEBUG_FUNCPTR(gst_uade_raw_dec_finalize);
	object_class->set_property = GST_DEBUG_FUNCPTR(gst_uade_raw_dec_set_property);
	object_class->get_property = GST_DEBUG_FUNCPTR(gst_uade_raw_dec_get_property);

	dec_class->loads_from_sinkpad = FALSE;

	dec_class->load_from_custom = GST_DEBUG_FUNCPTR(gst_uade_raw_dec_load_from_custom);

	dec_class->get_supported_output_modes = GST_DEBUG_FUNCPTR(gst_uade_raw_dec_get_supported_output_modes);
	dec_class->decode = GST_DEBUG_FUNCPTR(gst_uade_raw_dec_decode);

	dec_class->set_current_subsong = GST_DEBUG_FUNCPTR(gst_uade_raw_dec_set_current_subsong);
	dec_class->get_current_subsong = GST_DEBUG_FUNCPTR(gst_uade_raw_dec_get_current_subsong);
	dec_class->get_num_subsongs = GST_DEBUG_FUNCPTR(gst_uade_raw_dec_get_num_subsongs);

	/* TODO: inspect:
	 * - timeouts
	 * - pal/ntsc
	 * - looping control
	 * - typefind-like utility function
	 * - resampler [default,sinc,none]
	 * - check fixed caps & see if downstream caps' sample rate can be adapted
	 */

	g_object_class_install_property(
		object_class,
		PROP_LOCATION,
		g_param_spec_string(
			"location",
			"File Location",
			"Location of the music file to play",
			DEFAULT_LOCATION,
			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
		)
	);
	g_object_class_install_property(
		object_class,
		PROP_UADECORE_FILE,
		g_param_spec_string(
			"uadecore-file",
			"uadecore file location",
			"Location of the uadecore file",
			DEFAULT_LOCATION,
			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
		)
	);
	g_object_class_install_property(
		object_class,
		PROP_BASE_DIRECTORY,
		g_param_spec_string(
			"base-directory",
			"Base directory",
			"Directory containing eagleplayer.conf , the score file, and the players subdirectory",
			DEFAULT_LOCATION,
			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
		)
	);
	g_object_class_install_property(
		object_class,
		PROP_FILTER_TYPE,
		g_param_spec_enum(
			"filter-type",
			"Playback filter type",
			"Lowpass filter for the audio playback",
			GST_TYPE_UADE_FILTER_TYPE,
			DEFAULT_FILTER_TYPE,
			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
		)
	);
	g_object_class_install_property(
		object_class,
		PROP_HEADPHONE_MODE,
		g_param_spec_enum(
			"headphone-mode",
			"Headphone mode",
			"Headphone output mode to use",
			GST_TYPE_UADE_HEADPHONE_MODE,
			DEFAULT_HEADPHONE_MODE,
			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
		)
	);
	g_object_class_install_property(
		object_class,
		PROP_USE_FILTER,
		g_param_spec_boolean(
			"use-filter",
			"Use the lowpass filter",
			"Whether or not to use the configured lowpass filter",
			DEFAULT_USE_FILTER,
			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
		)
	);
	g_object_class_install_property(
		object_class,
		PROP_GAIN,
		g_param_spec_double(
			"gain",
			"Gain",
			"Gain to apply on the output; 0.0 = silence  1.0 = 100% (no change)",
			0.0, 128.0,
			DEFAULT_GAIN,
			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
		)
	);
	g_object_class_install_property(
		object_class,
		PROP_USE_POSTPROCESSING,
		g_param_spec_boolean(
			"use-postprocessing",
			"Use postprocessing",
			"Whether or not to use postprocessing effects (if set to FALSE, this disables: headphone mode, panning, gain)",
			DEFAULT_USE_POSTPROCESSING,
			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
		)
	);
	g_object_class_install_property(
		object_class,
		PROP_PANNING,
		g_param_spec_double(
			"panning",
			"Panning amount",
			"Amount of panning to apply; 0.0 = full stereo  1.0 = mono  2.0 = inverse stereo",
			0.0, 2.0,
			DEFAULT_PANNING,
			G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS
		)
	);

	gst_element_class_set_static_metadata(
		element_class,
		"UADE Amiga music player",
		"Codec/Decoder/Source/Audio",
		"Plays Commodore Amiga game and demo music",
		"Carlos Rafael Giani <*****@*****.**>"
	);
}
static void
ges_title_clip_class_init (GESTitleClipClass * klass)
{
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
  GESClipClass *timobj_class = GES_CLIP_CLASS (klass);
  GESContainerClass *container_class = GES_CONTAINER_CLASS (klass);

  g_type_class_add_private (klass, sizeof (GESTitleClipPrivate));

  object_class->get_property = ges_title_clip_get_property;
  object_class->set_property = ges_title_clip_set_property;
  object_class->dispose = ges_title_clip_dispose;

  /**
   * GESTitleClip:text:
   *
   * The text to diplay
   *
   * Deprecated: use ges_track_element_get/set_children_properties on the
   * underlying GESTrackElement instead
   */
  g_object_class_install_property (object_class, PROP_TEXT,
      g_param_spec_string ("text", "Text", "The text to display",
          DEFAULT_TEXT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
          GES_PARAM_NO_SERIALIZATION));

  /**
   * GESTitleClip:font-desc:
   *
   * Pango font description string
   *
   * Deprecated: use ges_track_element_get/set_children_properties on the
   * underlying GESTrackElement instead
   */
  g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FONT_DESC,
      g_param_spec_string ("font-desc", "font description",
          "Pango font description of font to be used for rendering. "
          "See documentation of pango_font_description_from_string "
          "for syntax.", DEFAULT_FONT_DESC,
          G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS |
          GES_PARAM_NO_SERIALIZATION));

  /**
   * GESTitleClip:valignment:
   *
   * Vertical alignent of the text
   *
   * Deprecated: use ges_track_element_get/set_children_properties on the
   * underlying GESTrackElement instead
   */
  g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_VALIGNMENT,
      g_param_spec_enum ("valignment", "vertical alignment",
          "Vertical alignment of the text", GES_TEXT_VALIGN_TYPE,
          DEFAULT_VALIGNMENT,
          G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS |
          GES_PARAM_NO_SERIALIZATION));
  /**
   * GESTitleClip:halignment:
   *
   * Horizontal alignment of the text
   *
   * Deprecated: use ges_track_element_get/set_children_properties on the
   * underlying GESTrackElement instead
   */
  g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_HALIGNMENT,
      g_param_spec_enum ("halignment", "horizontal alignment",
          "Horizontal alignment of the text",
          GES_TEXT_HALIGN_TYPE, DEFAULT_HALIGNMENT,
          G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS |
          GES_PARAM_NO_SERIALIZATION));

  timobj_class->create_track_element = ges_title_clip_create_track_element;

  container_class->child_added = _child_added;
  container_class->child_removed = _child_removed;

  /**
   * GESTitleClip:color:
   *
   * The color of the text
   *
   * Deprecated: use ges_track_element_get/set_children_properties on the
   * underlying GESTrackElement instead
   */

  g_object_class_install_property (object_class, PROP_COLOR,
      g_param_spec_uint ("color", "Color", "The color of the text",
          0, G_MAXUINT32, G_MAXUINT32, G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
          GES_PARAM_NO_SERIALIZATION));

  /**
   * GESTitleClip:background:
   *
   * The background of the text
   *
   * Deprecated: use ges_track_element_get/set_children_properties on the
   * underlying GESTrackElement instead
   */

  g_object_class_install_property (object_class, PROP_BACKGROUND,
      g_param_spec_uint ("background", "Background",
          "The background of the text", 0, G_MAXUINT32, G_MAXUINT32,
          G_PARAM_READWRITE | G_PARAM_CONSTRUCT | GES_PARAM_NO_SERIALIZATION));

  /**
   * GESTitleClip:xpos:
   *
   * The horizontal position of the text
   *
   * Deprecated: use ges_track_element_get/set_children_properties on the
   * underlying GESTrackElement instead
   */

  g_object_class_install_property (object_class, PROP_XPOS,
      g_param_spec_double ("xpos", "Xpos", "The horizontal position",
          0, 1, 0.5, G_PARAM_READWRITE | G_PARAM_CONSTRUCT
          | GES_PARAM_NO_SERIALIZATION));

  /**
   * GESTitleClip:ypos:
   *
   * The vertical position of the text
   *
   * Deprecated: use ges_track_element_get/set_children_properties on the
   * underlying GESTrackElement instead
   */

  g_object_class_install_property (object_class, PROP_YPOS,
      g_param_spec_double ("ypos", "Ypos", "The vertical position",
          0, 1, 0.5, G_PARAM_READWRITE | G_PARAM_CONSTRUCT
          | GES_PARAM_NO_SERIALIZATION));
}
Esempio n. 20
0
static void
gtk_scale_button_class_init (GtkScaleButtonClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
  GtkBindingSet *binding_set;

  g_type_class_add_private (klass, sizeof (GtkScaleButtonPrivate));

  gobject_class->constructor = gtk_scale_button_constructor;
  gobject_class->finalize = gtk_scale_button_finalize;
  gobject_class->dispose = gtk_scale_button_dispose;
  gobject_class->set_property = gtk_scale_button_set_property;
  gobject_class->get_property = gtk_scale_button_get_property;

  widget_class->button_press_event = gtk_scale_button_press;
  widget_class->key_release_event = gtk_scale_button_key_release;
  widget_class->scroll_event = gtk_scale_button_scroll;
  widget_class->screen_changed = gtk_scale_button_screen_changed;

  /**
   * GtkScaleButton:orientation:
   *
   * The orientation of the #GtkScaleButton's popup window.
   *
   * Since: 2.14
   **/
  g_object_class_override_property (gobject_class,
				    PROP_ORIENTATION,
				    "orientation");

  g_object_class_install_property (gobject_class,
				   PROP_VALUE,
				   g_param_spec_double ("value",
							P_("Value"),
							P_("The value of the scale"),
							-G_MAXDOUBLE,
							G_MAXDOUBLE,
							0,
							GTK_PARAM_READWRITE));

  g_object_class_install_property (gobject_class,
				   PROP_SIZE,
				   g_param_spec_enum ("size",
						      P_("Icon size"),
						      P_("The icon size"),
						      GTK_TYPE_ICON_SIZE,
						      GTK_ICON_SIZE_SMALL_TOOLBAR,
						      GTK_PARAM_READWRITE));

  g_object_class_install_property (gobject_class,
                                   PROP_ADJUSTMENT,
                                   g_param_spec_object ("adjustment",
							P_("Adjustment"),
							P_("The GtkAdjustment that contains the current value of this scale button object"),
                                                        GTK_TYPE_ADJUSTMENT,
                                                        GTK_PARAM_READWRITE));

  /**
   * GtkScaleButton:icons:
   *
   * The names of the icons to be used by the scale button.
   * The first item in the array will be used in the button
   * when the current value is the lowest value, the second
   * item for the highest value. All the subsequent icons will
   * be used for all the other values, spread evenly over the
   * range of values.
   *
   * If there's only one icon name in the @icons array, it will
   * be used for all the values. If only two icon names are in
   * the @icons array, the first one will be used for the bottom
   * 50% of the scale, and the second one for the top 50%.
   *
   * It is recommended to use at least 3 icons so that the
   * #GtkScaleButton reflects the current value of the scale
   * better for the users.
   *
   * Since: 2.12
   */
  g_object_class_install_property (gobject_class,
                                   PROP_ICONS,
                                   g_param_spec_boxed ("icons",
                                                       P_("Icons"),
                                                       P_("List of icon names"),
                                                       G_TYPE_STRV,
                                                       GTK_PARAM_READWRITE));

  /**
   * GtkScaleButton::value-changed:
   * @button: the object which received the signal
   * @value: the new value
   *
   * The ::value-changed signal is emitted when the value field has
   * changed.
   *
   * Since: 2.12
   */
  signals[VALUE_CHANGED] =
    g_signal_new (I_("value-changed"),
		  G_TYPE_FROM_CLASS (klass),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkScaleButtonClass, value_changed),
		  NULL, NULL,
		  _gtk_marshal_VOID__DOUBLE,
		  G_TYPE_NONE, 1, G_TYPE_DOUBLE);

  /**
   * GtkScaleButton::popup:
   * @button: the object which received the signal
   *
   * The ::popup signal is a
   * <link linkend="keybinding-signals">keybinding signal</link>
   * which gets emitted to popup the scale widget.
   *
   * The default bindings for this signal are Space, Enter and Return.
   *
   * Since: 2.12
   */
  signals[POPUP] =
    g_signal_new_class_handler (I_("popup"),
                                G_OBJECT_CLASS_TYPE (klass),
                                G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                                G_CALLBACK (gtk_scale_button_popup),
                                NULL, NULL,
                                g_cclosure_marshal_VOID__VOID,
                                G_TYPE_NONE, 0);

  /**
   * GtkScaleButton::popdown:
   * @button: the object which received the signal
   *
   * The ::popdown signal is a
   * <link linkend="keybinding-signals">keybinding signal</link>
   * which gets emitted to popdown the scale widget.
   *
   * The default binding for this signal is Escape.
   *
   * Since: 2.12
   */
  signals[POPDOWN] =
    g_signal_new_class_handler (I_("popdown"),
                                G_OBJECT_CLASS_TYPE (klass),
                                G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                                G_CALLBACK (gtk_scale_button_popdown),
                                NULL, NULL,
                                g_cclosure_marshal_VOID__VOID,
                                G_TYPE_NONE, 0);

  /* Key bindings */
  binding_set = gtk_binding_set_by_class (widget_class);

  gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
				"popup", 0);
  gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0,
				"popup", 0);
  gtk_binding_entry_add_signal (binding_set, GDK_Return, 0,
				"popup", 0);
  gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0,
				"popup", 0);
  gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0,
				"popup", 0);
  gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
				"popdown", 0);
}
Esempio n. 21
0
		object_class,
		PROP_MESSAGE,
		g_param_spec_string (
			"message",
			"Message",
			NULL,
			NULL,
			G_PARAM_READWRITE));

	g_object_class_install_property (
		object_class,
		PROP_WIDTH,
		g_param_spec_double (
			"width",
			"Width",
			NULL,
			0.0, G_MAXDOUBLE, 0.0,
			G_PARAM_READWRITE |
			G_PARAM_LAX_VALIDATION));

	g_object_class_install_property (
		object_class,
		PROP_HEIGHT,
		g_param_spec_double (
			"height",
			"Height",
			NULL,
			0.0, G_MAXDOUBLE, 0.0,
			G_PARAM_READABLE |
			G_PARAM_LAX_VALIDATION));
Esempio n. 22
0
static void
gtk_plot_array_class_init (GtkPlotArrayClass *klass)
{
  GtkPlotArrayClass *array_class;
  GObjectClass *gobject_class = G_OBJECT_CLASS(klass);

  array_parent_class = g_type_class_peek_parent (klass);

  array_class = (GtkPlotArrayClass *) klass;

  gobject_class->finalize = gtk_plot_array_finalize;
  gobject_class->set_property = gtk_plot_array_set_property;
  gobject_class->get_property = gtk_plot_array_get_property;

  g_object_class_install_property (gobject_class,
                           PROP_NAME,
  g_param_spec_string ("name",
                           P_("Name"),
                           P_("Name"),
                           NULL,
                           G_PARAM_READABLE|G_PARAM_WRITABLE));
  g_object_class_install_property (gobject_class,
                           PROP_LABEL,
  g_param_spec_string ("label",
                           P_("Label"),
                           P_("Label"),
                           NULL,
                           G_PARAM_READABLE|G_PARAM_WRITABLE));
  g_object_class_install_property (gobject_class,
                           PROP_DESCRIPTION,
  g_param_spec_string ("description",
                           P_("Description"),
                           P_("Description"),
                           NULL,
                           G_PARAM_READABLE|G_PARAM_WRITABLE));
  g_object_class_install_property (gobject_class,
                           PROP_TYPE,
  g_param_spec_int ("type",
                           P_("Type"),
                           P_("Type"),
                           0,G_MAXINT, 0,
                           G_PARAM_READABLE|G_PARAM_WRITABLE));
  g_object_class_install_property (gobject_class,
                           PROP_SIZE,
  g_param_spec_int ("size",
                           P_("Size"),
                           P_("Size"),
                           0, G_MAXINT, 0,
                           G_PARAM_READABLE|G_PARAM_WRITABLE));
  g_object_class_install_property (gobject_class,
                           PROP_OWN,
  g_param_spec_boolean ("own_data",
                           P_("Own Data"),
                           P_("Specifies if data should be freed when the array is destroyed"),
                           FALSE,
                           G_PARAM_READABLE|G_PARAM_WRITABLE));
  g_object_class_install_property (gobject_class,
                           PROP_REQUIRED,
  g_param_spec_boolean ("required",
                           P_("Required"),
                           P_("Required"),
                           FALSE,
                           G_PARAM_READABLE|G_PARAM_WRITABLE));
  g_object_class_install_property (gobject_class,
                           PROP_INDEPENDENT,
  g_param_spec_boolean ("independent",
                           P_("Independent"),
                           P_("Independent"),
                           FALSE,
                           G_PARAM_READABLE|G_PARAM_WRITABLE));
  g_object_class_install_property (gobject_class,
                           PROP_SCALE,
  g_param_spec_double ("scale",
                           P_("Scale"),
                           P_("Scale"),
                           0, G_MAXDOUBLE, 1.0,
                           G_PARAM_READABLE|G_PARAM_WRITABLE));
  g_object_class_install_property (gobject_class,
                           PROP_DATA,
  g_param_spec_pointer ("array_data",
                           P_("Data"),
                           P_("Data"),
                           G_PARAM_READABLE|G_PARAM_WRITABLE));

}
Esempio n. 23
0
static void
mx_adjustment_class_init (MxAdjustmentClass *klass)
{
  GObjectClass *object_class = G_OBJECT_CLASS (klass);

  g_type_class_add_private (klass, sizeof (MxAdjustmentPrivate));

  object_class->constructed = mx_adjustment_constructed;
  object_class->get_property = mx_adjustment_get_property;
  object_class->set_property = mx_adjustment_set_property;
  object_class->dispose = mx_adjustment_dispose;

  g_object_class_install_property (object_class,
                                   PROP_LOWER,
                                   g_param_spec_double ("lower",
                                                        "Lower",
                                                        "Lower bound",
                                                        -G_MAXDOUBLE,
                                                        G_MAXDOUBLE,
                                                        0.0,
                                                        MX_PARAM_READWRITE |
                                                        G_PARAM_CONSTRUCT));
  g_object_class_install_property (object_class,
                                   PROP_UPPER,
                                   g_param_spec_double ("upper",
                                                        "Upper",
                                                        "Upper bound",
                                                        -G_MAXDOUBLE,
                                                        G_MAXDOUBLE,
                                                        0.0,
                                                        MX_PARAM_READWRITE |
                                                        G_PARAM_CONSTRUCT));
  g_object_class_install_property (object_class,
                                   PROP_VALUE,
                                   g_param_spec_double ("value",
                                                        "Value",
                                                        "Current value",
                                                        -G_MAXDOUBLE,
                                                        G_MAXDOUBLE,
                                                        0.0,
                                                        MX_PARAM_READWRITE |
                                                        G_PARAM_CONSTRUCT));
  g_object_class_install_property (object_class,
                                   PROP_STEP_INC,
                                   g_param_spec_double ("step-increment",
                                                        "Step Increment",
                                                        "Step increment",
                                                        0.0,
                                                        G_MAXDOUBLE,
                                                        1.0,
                                                        MX_PARAM_READWRITE |
                                                        G_PARAM_CONSTRUCT));
  g_object_class_install_property (object_class,
                                   PROP_PAGE_INC,
                                   g_param_spec_double ("page-increment",
                                                        "Page Increment",
                                                        "Page increment",
                                                        0.0,
                                                        G_MAXDOUBLE,
                                                        0.0,
                                                        MX_PARAM_READWRITE |
                                                        G_PARAM_CONSTRUCT));
  g_object_class_install_property (object_class,
                                   PROP_PAGE_SIZE,
                                   g_param_spec_double ("page-size",
                                                        "Page Size",
                                                        "Page size",
                                                        0.0,
                                                        G_MAXDOUBLE,
                                                        0.0,
                                                        MX_PARAM_READWRITE |
                                                        G_PARAM_CONSTRUCT));
  g_object_class_install_property (object_class,
                                   PROP_ELASTIC,
                                   g_param_spec_boolean ("elastic",
                                                         "Elastic",
                                                         "Make interpolation "
                                                         "behave in an "
                                                         "'elastic' way and "
                                                         "stop clamping value.",
                                                         FALSE,
                                                         MX_PARAM_READWRITE));
  g_object_class_install_property (object_class,
                                   PROP_CLAMP_VALUE,
                                   g_param_spec_boolean ("clamp-value",
                                                         "Clamp value",
                                                         "Clamp the adjustment "
                                                         "value between the "
                                                         "lower and upper "
                                                         "values, respecting "
                                                         "the page-size.",
                                                         TRUE,
                                                         MX_PARAM_READWRITE));

  /**
   * MxAdjustment::changed-immediate:
   *
   * Emitted when any of the adjustment values have changed
   */
  signals[CHANGED_IMMEDIATE] =
    g_signal_new ("changed-immediate",
                  G_TYPE_FROM_CLASS (klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (MxAdjustmentClass, changed_immediate),
                  NULL, NULL,
                  _mx_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);

  /**
   * MxAdjustment::changed:
   *
   * Emitted when any of the adjustment values have changed at the
   * next iteration of the GLib mainloop.
   */
  signals[CHANGED] =
    g_signal_new ("changed",
                  G_TYPE_FROM_CLASS (klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (MxAdjustmentClass, changed),
                  NULL, NULL,
                  _mx_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);

  /**
   * MxAdjustment::interpolation-completed:
   *
   * Emitted when the animation started by mx_adjustment_interpolate completes
   */
  signals[INTERPOLATION_COMPLETED] =
    g_signal_new ("interpolation-completed",
                  G_TYPE_FROM_CLASS (klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (MxAdjustmentClass, interpolation_completed),
                  NULL, NULL,
                  _mx_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
}
Esempio n. 24
0
static void
gimp_ruler_class_init (GimpRulerClass *klass)
{
  GObjectClass   *object_class = G_OBJECT_CLASS (klass);
  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);

  object_class->dispose             = gimp_ruler_dispose;
  object_class->set_property        = gimp_ruler_set_property;
  object_class->get_property        = gimp_ruler_get_property;

  widget_class->realize             = gimp_ruler_realize;
  widget_class->unrealize           = gimp_ruler_unrealize;
  widget_class->map                 = gimp_ruler_map;
  widget_class->unmap               = gimp_ruler_unmap;
  widget_class->size_allocate       = gimp_ruler_size_allocate;
  widget_class->size_request        = gimp_ruler_size_request;
  widget_class->style_set           = gimp_ruler_style_set;
  widget_class->motion_notify_event = gimp_ruler_motion_notify;
  widget_class->expose_event        = gimp_ruler_expose;

  g_type_class_add_private (object_class, sizeof (GimpRulerPrivate));

  g_object_class_install_property (object_class,
                                   PROP_ORIENTATION,
                                   g_param_spec_enum ("orientation",
                                                      "Orientation",
                                                      "The orientation of the ruler",
                                                      GTK_TYPE_ORIENTATION,
                                                      GTK_ORIENTATION_HORIZONTAL,
                                                      GIMP_PARAM_READWRITE));

  g_object_class_install_property (object_class,
                                   PROP_UNIT,
                                   gimp_param_spec_unit ("unit",
                                                         "Unit",
                                                         "Unit of ruler",
                                                         TRUE, TRUE,
                                                         GIMP_UNIT_PIXEL,
                                                         GIMP_PARAM_READWRITE));

  g_object_class_install_property (object_class,
                                   PROP_LOWER,
                                   g_param_spec_double ("lower",
                                                        "Lower",
                                                        "Lower limit of ruler",
                                                        -G_MAXDOUBLE,
                                                        G_MAXDOUBLE,
                                                        0.0,
                                                        GIMP_PARAM_READWRITE));

  g_object_class_install_property (object_class,
                                   PROP_UPPER,
                                   g_param_spec_double ("upper",
                                                        "Upper",
                                                        "Upper limit of ruler",
                                                        -G_MAXDOUBLE,
                                                        G_MAXDOUBLE,
                                                        0.0,
                                                        GIMP_PARAM_READWRITE));

  g_object_class_install_property (object_class,
                                   PROP_POSITION,
                                   g_param_spec_double ("position",
                                                        "Position",
                                                        "Position of mark on the ruler",
                                                        -G_MAXDOUBLE,
                                                        G_MAXDOUBLE,
                                                        0.0,
                                                        GIMP_PARAM_READWRITE));

  g_object_class_install_property (object_class,
                                   PROP_MAX_SIZE,
                                   g_param_spec_double ("max-size",
                                                        "Max Size",
                                                        "Maximum size of the ruler",
                                                        -G_MAXDOUBLE,
                                                        G_MAXDOUBLE,
                                                        0.0,
                                                        GIMP_PARAM_READWRITE));

  gtk_widget_class_install_style_property (widget_class,
                                           g_param_spec_double ("font-scale",
                                                                NULL, NULL,
                                                                0.0,
                                                                G_MAXDOUBLE,
                                                                DEFAULT_RULER_FONT_SCALE,
                                                                GIMP_PARAM_READABLE));
}
Esempio n. 25
0
static void
gst_level_class_init (GstLevelClass * klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
  GstBaseTransformClass *trans_class = GST_BASE_TRANSFORM_CLASS (klass);

  gobject_class->set_property = gst_level_set_property;
  gobject_class->get_property = gst_level_get_property;
  gobject_class->finalize = gst_level_finalize;

  /**
   * GstLevel:post-messages
   *
   * Post messages on the bus with level information.
   *
   * Since: 1.1.0
   */
  g_object_class_install_property (gobject_class, PROP_POST_MESSAGES,
      g_param_spec_boolean ("post-messages", "Post Messages",
          "Whether to post a 'level' element message on the bus for each "
          "passed interval", TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /* FIXME(2.0): remove this property */
  /**
   * GstLevel:post-messages
   *
   * Post messages on the bus with level information.
   *
   * Deprecated: use the #GstLevel:post-messages property
   */
#ifndef GST_REMOVE_DEPRECATED
  g_object_class_install_property (gobject_class, PROP_MESSAGE,
      g_param_spec_boolean ("message", "message",
          "Post a 'level' message for each passed interval "
          "(deprecated, use the post-messages property instead)", TRUE,
          G_PARAM_READWRITE | G_PARAM_DEPRECATED | G_PARAM_STATIC_STRINGS));
#endif
  g_object_class_install_property (gobject_class, PROP_INTERVAL,
      g_param_spec_uint64 ("interval", "Interval",
          "Interval of time between message posts (in nanoseconds)",
          1, G_MAXUINT64, GST_SECOND / 10,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, PROP_PEAK_TTL,
      g_param_spec_uint64 ("peak-ttl", "Peak TTL",
          "Time To Live of decay peak before it falls back (in nanoseconds)",
          0, G_MAXUINT64, GST_SECOND / 10 * 3,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (gobject_class, PROP_PEAK_FALLOFF,
      g_param_spec_double ("peak-falloff", "Peak Falloff",
          "Decay rate of decay peak after TTL (in dB/sec)",
          0.0, G_MAXDOUBLE, 10.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  GST_DEBUG_CATEGORY_INIT (level_debug, "level", 0, "Level calculation");

  gst_element_class_add_static_pad_template (element_class,
      &sink_template_factory);
  gst_element_class_add_static_pad_template (element_class,
      &src_template_factory);
  gst_element_class_set_static_metadata (element_class, "Level",
      "Filter/Analyzer/Audio",
      "RMS/Peak/Decaying Peak Level messager for audio/raw",
      "Thomas Vander Stichele <thomas at apestaart dot org>");

  trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_level_set_caps);
  trans_class->start = GST_DEBUG_FUNCPTR (gst_level_start);
  trans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_level_transform_ip);
  trans_class->sink_event = GST_DEBUG_FUNCPTR (gst_level_sink_event);
  trans_class->passthrough_on_same_caps = TRUE;
}
Esempio n. 26
0
static void
gst_smpte_alpha_class_init (GstSMPTEAlphaClass * klass)
{
  GObjectClass *gobject_class = (GObjectClass *) klass;
  GstElementClass *element_class = (GstElementClass *) (klass);
  GstBaseTransformClass *trans_class = (GstBaseTransformClass *) klass;
  GstVideoFilterClass *vfilter_class = (GstVideoFilterClass *) klass;

  gobject_class->set_property = gst_smpte_alpha_set_property;
  gobject_class->get_property = gst_smpte_alpha_get_property;

  gobject_class->finalize = (GObjectFinalizeFunc) gst_smpte_alpha_finalize;

  _gst_mask_init ();

  g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_TYPE,
      g_param_spec_enum ("type", "Type", "The type of transition to use",
          GST_TYPE_SMPTE_TRANSITION_TYPE, DEFAULT_PROP_TYPE,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BORDER,
      g_param_spec_int ("border", "Border",
          "The border width of the transition", 0, G_MAXINT,
          DEFAULT_PROP_BORDER,
          GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DEPTH,
      g_param_spec_int ("depth", "Depth", "Depth of the mask in bits", 1, 24,
          DEFAULT_PROP_DEPTH, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_POSITION,
      g_param_spec_double ("position", "Position",
          "Position of the transition effect", 0.0, 1.0, DEFAULT_PROP_POSITION,
          GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GstSMPTEAlpha:invert:
   *
   * Set to TRUE to invert the transition mask (ie. flip it horizontally).
   *
   * Since: 0.10.23
   */
  g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_INVERT,
      g_param_spec_boolean ("invert", "Invert",
          "Invert transition mask", DEFAULT_PROP_POSITION,
          GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  trans_class->before_transform =
      GST_DEBUG_FUNCPTR (gst_smpte_alpha_before_transform);
  trans_class->transform_caps =
      GST_DEBUG_FUNCPTR (gst_smpte_alpha_transform_caps);

  vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_smpte_alpha_set_info);
  vfilter_class->transform_frame =
      GST_DEBUG_FUNCPTR (gst_smpte_alpha_transform_frame);

  gst_element_class_add_pad_template (element_class,
      gst_static_pad_template_get (&gst_smpte_alpha_sink_template));
  gst_element_class_add_pad_template (element_class,
      gst_static_pad_template_get (&gst_smpte_alpha_src_template));
  gst_element_class_set_static_metadata (element_class, "SMPTE transitions",
      "Filter/Editor/Video",
      "Apply the standard SMPTE transitions as alpha on video images",
      "Wim Taymans <*****@*****.**>");
}
Esempio n. 27
0
/* initialize the opencvtextoverlay's class */
static void
gst_opencv_text_overlay_class_init (GstOpencvTextOverlayClass * klass)
{
  GObjectClass *gobject_class;

  gobject_class = (GObjectClass *) klass;

  parent_class = g_type_class_peek_parent (klass);
  gobject_class->finalize =
      GST_DEBUG_FUNCPTR (gst_opencv_text_overlay_finalize);

  gobject_class->set_property = gst_opencv_text_overlay_set_property;
  gobject_class->get_property = gst_opencv_text_overlay_get_property;


  g_object_class_install_property (gobject_class, PROP_TEXT,
      g_param_spec_string ("text", "text",
          "Text to be display.", DEFAULT_PROP_TEXT,
          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_XPOS,
      g_param_spec_int ("xpos", "horizontal position",
          "Sets the Horizontal position", 0, G_MAXINT,
          DEFAULT_PROP_XPOS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_YPOS,
      g_param_spec_int ("ypos", "vertical position",
          "Sets the Vertical position", 0, G_MAXINT,
          DEFAULT_PROP_YPOS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_THICKNESS,
      g_param_spec_int ("thickness", "font thickness",
          "Sets the Thickness of Font", 0, G_MAXINT,
          DEFAULT_PROP_THICKNESS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_COLOR_R,
      g_param_spec_int ("colorR", "color -Red ",
          "Sets the color -R", 0, 255,
          DEFAULT_PROP_COLOR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_COLOR_G,
      g_param_spec_int ("colorG", "color -Green",
          "Sets the color -G", 0, 255,
          DEFAULT_PROP_COLOR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_COLOR_B,
      g_param_spec_int ("colorB", "color -Blue",
          "Sets the color -B", 0, 255,
          DEFAULT_PROP_COLOR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_HEIGHT,
      g_param_spec_double ("height", "Height",
          "Sets the height of fonts", 1.0, 5.0,
          DEFAULT_HEIGHT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  g_object_class_install_property (gobject_class, PROP_WIDTH,
      g_param_spec_double ("width", "Width",
          "Sets the width of fonts", 1.0, 5.0,
          DEFAULT_WIDTH, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

}
Esempio n. 28
0
static void
mnb_zones_preview_class_init (MnbZonesPreviewClass *klass)
{
  GObjectClass *object_class = G_OBJECT_CLASS (klass);
  ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);

  g_type_class_add_private (klass, sizeof (MnbZonesPreviewPrivate));

  object_class->get_property = mnb_zones_preview_get_property;
  object_class->set_property = mnb_zones_preview_set_property;
  object_class->dispose = mnb_zones_preview_dispose;
  object_class->finalize = mnb_zones_preview_finalize;

  actor_class->paint = mnb_zones_preview_paint;
  actor_class->map = mnb_zones_preview_map;
  actor_class->unmap = mnb_zones_preview_unmap;
  actor_class->get_preferred_width = mnb_zones_preview_get_preferred_width;
  actor_class->get_preferred_height = mnb_zones_preview_get_preferred_height;
  actor_class->allocate = mnb_zones_preview_allocate;

  g_object_class_install_property (object_class,
                                   PROP_ZOOM,
                                   g_param_spec_double ("zoom",
                                                        "Zoom",
                                                        "Simulated zoom level.",
                                                        0.0, G_MAXDOUBLE, 1.0,
                                                        G_PARAM_READWRITE |
                                                        G_PARAM_STATIC_NAME |
                                                        G_PARAM_STATIC_NICK |
                                                        G_PARAM_STATIC_BLURB));

  g_object_class_install_property (object_class,
                                   PROP_WORKSPACE,
                                   g_param_spec_double ("workspace",
                                                        "Workspace",
                                                        "Current workspace.",
                                                        0.0, G_MAXDOUBLE, 0.0,
                                                        G_PARAM_READWRITE |
                                                        G_PARAM_STATIC_NAME |
                                                        G_PARAM_STATIC_NICK |
                                                        G_PARAM_STATIC_BLURB));

  g_object_class_install_property (object_class,
                                   PROP_WORKSPACE_WIDTH,
                                   g_param_spec_uint ("workspace-width",
                                                      "Workspace width",
                                                      "Width of a workspace.",
                                                      0, G_MAXUINT, 0,
                                                      G_PARAM_READWRITE |
                                                      G_PARAM_STATIC_NAME |
                                                      G_PARAM_STATIC_NICK |
                                                      G_PARAM_STATIC_BLURB));

  g_object_class_install_property (object_class,
                                   PROP_WORKSPACE_HEIGHT,
                                   g_param_spec_uint ("workspace-height",
                                                      "Workspace height",
                                                      "Height of a workspace.",
                                                      0, G_MAXUINT, 0,
                                                      G_PARAM_READWRITE |
                                                      G_PARAM_STATIC_NAME |
                                                      G_PARAM_STATIC_NICK |
                                                      G_PARAM_STATIC_BLURB));

  signals[SWITCH_COMPLETED] =
    g_signal_new ("switch-completed",
                  G_TYPE_FROM_CLASS (klass),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (MnbZonesPreviewClass, switch_completed),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
}
        g_object_class_install_property (object_class, PROP_WEIGHT,
                g_param_spec_int ("weight",
                                  "Font Weight", "The font weight to use",
                                  0, G_MAXINT, PANGO_WEIGHT_NORMAL,
                                  G_PARAM_READWRITE));

        g_object_class_install_property (object_class, PROP_WEIGHT_SET,
                g_param_spec_boolean ("weight-set",
                                      "Font Weight Set", "Whether a font weight is set",
                                      FALSE,
                                      G_PARAM_READWRITE));

        g_object_class_install_property (object_class, PROP_SCALE,
                g_param_spec_double ("scale",
                                     "Font Scale", "The font scale to use",
                                     0.0, G_MAXDOUBLE, 1.0,
                                     G_PARAM_READWRITE));

        g_object_class_install_property (object_class, PROP_SCALE_SET,
                g_param_spec_boolean ("scale-set",
                                      "Font Scale Set", "Whether a font scale is set",
                                      FALSE,
                                      G_PARAM_READWRITE));

        g_type_class_add_private (class, sizeof (UmEditableButtonPrivate));
}

static void
start_editing (UmEditableButton *button)
{
        g_signal_emit (button, signals[START_EDITING], 0);
Esempio n. 30
0
static void
gog_pie_plot_class_init (GogPlotClass *plot_klass)
{
	GObjectClass *gobject_klass = (GObjectClass *) plot_klass;
	GogObjectClass *gog_klass = (GogObjectClass *) plot_klass;

	pie_parent_klass = g_type_class_peek_parent (plot_klass);
	gobject_klass->set_property = gog_pie_plot_set_property;
	gobject_klass->get_property = gog_pie_plot_get_property;

	gog_klass->update	= gog_pie_plot_update;
	gog_klass->type_name	= gog_pie_plot_type_name;
#ifdef GOFFICE_WITH_GTK
	gog_klass->populate_editor = gog_pie_plot_populate_editor;
#endif
	gog_klass->view_type	= gog_pie_view_get_type ();

	g_object_class_install_property (gobject_klass, PLOT_PROP_INITIAL_ANGLE,
		g_param_spec_double ("initial-angle",
			_("Initial angle"),
			_("Degrees clockwise from 12 O'Clock."),
			-G_MAXFLOAT, G_MAXFLOAT, 0.,
			GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
	g_object_class_install_property (gobject_klass, PLOT_PROP_DEFAULT_SEPARATION,
		g_param_spec_double ("default-separation",
			_("Default separation"),
			_("Default amount a slice is extended as a percentage of the radius"),
			0, G_MAXFLOAT, 0.,
			GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
	g_object_class_install_property (gobject_klass, PLOT_PROP_IN_3D,
		g_param_spec_boolean ("in-3d",
			_("In 3D"),
			_("Draw 3DS wedges"),
			FALSE,
			GSF_PARAM_STATIC | G_PARAM_READWRITE));
	g_object_class_install_property (gobject_klass, PLOT_PROP_SPAN,
		g_param_spec_double ("span",
			_("Span"),
			_("Total angle used as a percentage of the full circle"),
			10., 100., 100.,
			GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
	g_object_class_install_property (gobject_klass, PLOT_PROP_SHOW_NEGS,
		g_param_spec_string ("show-negs",
			_("Show negative values"),
			_("How negative values are displayed"),
			"absolute",
			GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));

	{
		static GogSeriesDimDesc dimensions[] = {
			{ N_("Labels"), GOG_SERIES_SUGGESTED, TRUE,
			  GOG_DIM_LABEL, GOG_MS_DIM_CATEGORIES },
			{ N_("Values"), GOG_SERIES_REQUIRED, FALSE,
			  GOG_DIM_VALUE, GOG_MS_DIM_VALUES }
		};
		plot_klass->desc.series.dim = dimensions;
		plot_klass->desc.series.num_dim = G_N_ELEMENTS (dimensions);
		plot_klass->desc.series.style_fields = GO_STYLE_OUTLINE | GO_STYLE_FILL;
	}
	plot_klass->desc.num_series_max = 1;
	plot_klass->series_type  = gog_pie_series_get_type ();
}