コード例 #1
0
struct _TransliteratorIcuClass
{
  TranslitTransliteratorClass parent_class;
};

typedef struct _TransliteratorIcu TransliteratorIcu;
typedef struct _TransliteratorIcuClass TransliteratorIcuClass;

static void initable_iface_init (GInitableIface *initable_iface);

G_DEFINE_DYNAMIC_TYPE_EXTENDED (TransliteratorIcu,
				transliterator_icu,
				TRANSLIT_TYPE_TRANSLITERATOR,
				0,
				G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
						       initable_iface_init));

static gchar *
ustring_to_utf8 (const UChar *ustr, int32_t ustrLength)
{
  gchar *dest;
  int32_t destLength;
  UErrorCode errorCode;

  errorCode = 0;
  u_strToUTF8 (NULL, 0, &destLength, ustr, ustrLength, &errorCode);
  if (errorCode != U_BUFFER_OVERFLOW_ERROR)
    {
      g_warning ("can't get the number of byte required to convert ustring: %s",
		 u_errorName (errorCode));
      return NULL;
コード例 #2
0
ファイル: mx-combo-box.c プロジェクト: GunioRobot/mx
 *
 * #MxComboBox combines a button with a popup menu to allow the user to select
 * an option from a list.
 */

#include "mx-combo-box.h"
#include "mx-menu.h"

#include "mx-private.h"
#include "mx-stylable.h"

static void mx_focusable_iface_init (MxFocusableIface *iface);
static void mx_stylable_iface_init (MxStylableIface *iface);

G_DEFINE_TYPE_WITH_CODE (MxComboBox, mx_combo_box, MX_TYPE_WIDGET,
                         G_IMPLEMENT_INTERFACE (MX_TYPE_FOCUSABLE,
                                                mx_focusable_iface_init)
                         G_IMPLEMENT_INTERFACE (MX_TYPE_STYLABLE,
                                                mx_stylable_iface_init))

#define COMBO_BOX_PRIVATE(o) \
  (G_TYPE_INSTANCE_GET_PRIVATE ((o), MX_TYPE_COMBO_BOX, MxComboBoxPrivate))

struct _MxComboBoxPrivate
{
  ClutterActor *label;
  ClutterActor *icon;
  ClutterActor *marker;
  GSList       *actions;
  gfloat        clip_x;
  gfloat        clip_y;
  gint          index;
コード例 #3
0
#include "mex-action-list.h"
#include "mex-action-manager.h"
#include "mex-content-view.h"
#include "mex-main.h"
#include "mex-tile.h"
#include "mex-program.h"
#include "mex-private.h"
#include "mex-utils.h"
#include "mex-queue-button.h"
#include "mex-info-panel.h"
#include "mex-content-tile.h"

static void mex_content_view_iface_init (MexContentViewIface *iface);
static void mex_content_box_focusable_iface_init (MxFocusableIface *iface);
G_DEFINE_TYPE_WITH_CODE (MexContentBox, mex_content_box, MX_TYPE_WIDGET,
                         G_IMPLEMENT_INTERFACE (MEX_TYPE_CONTENT_VIEW,
                                                mex_content_view_iface_init)
                         G_IMPLEMENT_INTERFACE (MX_TYPE_FOCUSABLE,
                                                mex_content_box_focusable_iface_init))

#define CONTENT_BOX_PRIVATE(o) \
  (G_TYPE_INSTANCE_GET_PRIVATE ((o), MEX_TYPE_CONTENT_BOX, MexContentBoxPrivate))

#define DEFAULT_THUMB_WIDTH 426
#define DEFAULT_THUMB_HEIGHT 240
#define DEFAULT_THUMB_RATIO ((float)DEFAULT_THUMB_HEIGHT/(float)DEFAULT_THUMB_WIDTH)

enum
{
  PROP_0,

  PROP_OPEN,
コード例 #4
0
ファイル: gtksearchentry.c プロジェクト: 3v1n0/gtk
static guint signals[LAST_SIGNAL] = { 0 };

typedef struct {
  guint delayed_changed_id;
} GtkSearchEntryPrivate;

static void gtk_search_entry_icon_release  (GtkEntry             *entry,
                                            GtkEntryIconPosition  icon_pos);
static void gtk_search_entry_changed       (GtkEditable          *editable);
static void gtk_search_entry_editable_init (GtkEditableInterface *iface);

static GtkEditableInterface *parent_editable_iface;

G_DEFINE_TYPE_WITH_CODE (GtkSearchEntry, gtk_search_entry, GTK_TYPE_ENTRY,
                         G_ADD_PRIVATE (GtkSearchEntry)
                         G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE,
                                                gtk_search_entry_editable_init))

/* 150 mseconds of delay */
#define DELAYED_TIMEOUT_ID 150

/* This widget got created without a private structure, meaning
 * that we cannot now have one without breaking ABI */
#define GET_PRIV(e) ((GtkSearchEntryPrivate *) gtk_search_entry_get_instance_private ((GtkSearchEntry *) (e)))

static void
gtk_search_entry_finalize (GObject *object)
{
  GtkSearchEntryPrivate *priv = GET_PRIV (object);

  if (priv->delayed_changed_id > 0)
    g_source_remove (priv->delayed_changed_id);
コード例 #5
0
#include "nm-properties-changed-signal.h"
#include "nm-connection.h"
#include "nm-setting-connection.h"
#include "nm-setting-wimax.h"
#include "nm-utils.h"
#include "nm-rfkill.h"
#include "iwmxsdk.h"

static gboolean impl_device_get_nsp_list (NMDeviceWimax *device, GPtrArray **list, GError **error);

#include "nm-device-wimax-glue.h"

static void device_interface_init (NMDeviceInterface *iface_class);

G_DEFINE_TYPE_EXTENDED (NMDeviceWimax, nm_device_wimax, NM_TYPE_DEVICE, 0,
						G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_INTERFACE, device_interface_init))

enum {
	PROP_0,
	PROP_HW_ADDRESS,
	PROP_ACTIVE_NSP,
	PROP_CENTER_FREQ,
	PROP_RSSI,
	PROP_CINR,
	PROP_TX_POWER,
	PROP_BSID,

	LAST_PROP
};

enum {
コード例 #6
0
ファイル: sexy-icon-entry.c プロジェクト: ib/xarchiver
static gint sexy_icon_entry_expose(GtkWidget *widget, GdkEventExpose *event);
static gint sexy_icon_entry_enter_notify(GtkWidget *widget,
											   GdkEventCrossing *event);
static gint sexy_icon_entry_leave_notify(GtkWidget *widget,
											   GdkEventCrossing *event);
static gint sexy_icon_entry_button_press(GtkWidget *widget,
											   GdkEventButton *event);
static gint sexy_icon_entry_button_release(GtkWidget *widget,
												 GdkEventButton *event);

static GtkEntryClass *parent_class = NULL;
static guint signals[LAST_SIGNAL] = {0};

G_DEFINE_TYPE_EXTENDED(SexyIconEntry, sexy_icon_entry, GTK_TYPE_ENTRY,
					   0,
					   G_IMPLEMENT_INTERFACE(GTK_TYPE_EDITABLE,
											 sexy_icon_entry_editable_init));

static void
sexy_icon_entry_class_init(SexyIconEntryClass *klass)
{
	GObjectClass *gobject_class;
	GtkObjectClass *object_class;
	GtkWidgetClass *widget_class;
//	GtkEntryClass *entry_class;

	parent_class = g_type_class_peek_parent(klass);

	gobject_class = G_OBJECT_CLASS(klass);
	object_class  = GTK_OBJECT_CLASS(klass);
	widget_class  = GTK_WIDGET_CLASS(klass);
//	entry_class   = GTK_ENTRY_CLASS(klass);
コード例 #7
0
ファイル: mx-notebook.c プロジェクト: 3v1n0/mx
 * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Written by: Thomas Wood <[email protected]>
 *
 */

#include <config.h>
#include "mx-notebook.h"
#include "mx-private.h"
#include "mx-focusable.h"

static void clutter_container_iface_init (ClutterContainerIface *iface);
static void mx_focusable_iface_init (MxFocusableIface *iface);

G_DEFINE_TYPE_WITH_CODE (MxNotebook, mx_notebook, MX_TYPE_WIDGET,
                         G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER,
                                                clutter_container_iface_init)
                         G_IMPLEMENT_INTERFACE (MX_TYPE_FOCUSABLE,
                                                mx_focusable_iface_init))

#define NOTEBOOK_PRIVATE(o) \
  (G_TYPE_INSTANCE_GET_PRIVATE ((o), MX_TYPE_NOTEBOOK, MxNotebookPrivate))

struct _MxNotebookPrivate
{
  ClutterActor *current_page;

  GList *children;
};

enum
{
コード例 #8
0
{
  EVENT_ACTIVATED,
  LAST_SIGNAL
};

enum
{
  PROP_0,
  PROP_DATE,
  NUM_PROPS
};

static guint signals[LAST_SIGNAL] = { 0, };

G_DEFINE_TYPE_WITH_CODE (GcalWeekView, gcal_week_view, GTK_TYPE_BOX,
                         G_IMPLEMENT_INTERFACE (GCAL_TYPE_VIEW, gcal_view_interface_init)
                         G_IMPLEMENT_INTERFACE (E_TYPE_CAL_DATA_MODEL_SUBSCRIBER,
                                                gcal_data_model_subscriber_interface_init));

/* Callbacks */
static void
on_event_activated (GcalWeekView *self,
                    GtkWidget    *widget)
{
  g_signal_emit (self, signals[EVENT_ACTIVATED], 0, widget);
}

/* Auxiliary methods */
static gboolean
update_grid_scroll_position (GcalWeekView *self)
{
コード例 #9
0
ファイル: mm-manager.c プロジェクト: telemaco/ModemManager
 *
 * Author: Aleksander Morgado <[email protected]>
 */

#include "ModemManager.h"
#include <mm-gdbus-manager.h>
#include "mm-manager.h"

static void initable_iface_init       (GInitableIface      *iface);
static void async_initable_iface_init (GAsyncInitableIface *iface);

static GInitableIface      *initable_parent_iface;
static GAsyncInitableIface *async_initable_parent_iface;

G_DEFINE_TYPE_EXTENDED (MMManager, mm_manager, MM_GDBUS_TYPE_OBJECT_MANAGER_CLIENT, 0,
                        G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init)
                        G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init));

struct _MMManagerPrivate {
  /* The proxy for the Manager interface */
  MmGdbusOrgFreedesktopModemManager1 *manager_iface_proxy;
};

/**
 * mm_manager_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
コード例 #10
0
ファイル: glade-box-editor.c プロジェクト: GNOME/glade
static void glade_box_editor_editable_init (GladeEditableIface * iface);
static void glade_box_editor_grab_focus (GtkWidget * widget);
static void use_center_child_toggled (GtkWidget *widget, GladeBoxEditor * box_editor);


struct _GladeBoxEditorPrivate
{
  GtkWidget *embed;
  GtkWidget *use_center_child;
};

static GladeEditableIface *parent_editable_iface;

G_DEFINE_TYPE_WITH_CODE (GladeBoxEditor, glade_box_editor, GLADE_TYPE_EDITOR_SKELETON,
                         G_ADD_PRIVATE (GladeBoxEditor)
                         G_IMPLEMENT_INTERFACE (GLADE_TYPE_EDITABLE,
                                                glade_box_editor_editable_init));

static void
glade_box_editor_class_init (GladeBoxEditorClass * klass)
{
  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);

  widget_class->grab_focus = glade_box_editor_grab_focus;

  gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/gladegtk/glade-box-editor.ui");
  gtk_widget_class_bind_template_child_private (widget_class, GladeBoxEditor, embed);
  gtk_widget_class_bind_template_child_private (widget_class, GladeBoxEditor, use_center_child);

  gtk_widget_class_bind_template_callback (widget_class, use_center_child_toggled);
}
コード例 #11
0
ファイル: mech-surface.c プロジェクト: arthurfait/mechane
  gint height;
  gint cache_width;
  gint cache_height;

  gdouble scale_x;
  gdouble scale_y;

  guint surface_type  : 3;
  guint renderer_type : 2;
};

static void mech_surface_initable_iface_init (GInitableIface *iface);

G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MechSurface, mech_surface, G_TYPE_OBJECT,
                                  G_ADD_PRIVATE (MechSurface)
                                  G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
                                                         mech_surface_initable_iface_init))

static gboolean
mech_surface_initable_init (GInitable     *initable,
                            GCancellable  *cancellable,
                            GError       **error)
{
  return TRUE;
}

static void
mech_surface_initable_iface_init (GInitableIface *iface)
{
  iface->init = mech_surface_initable_init;
}
コード例 #12
0
ファイル: gtkstylecascade.c プロジェクト: mariospr/gtk
    }
  gtk_style_cascade_iter_clear (&iter);
}

static void
gtk_style_cascade_provider_private_iface_init (GtkStyleProviderPrivateInterface *iface)
{
  iface->get_color = gtk_style_cascade_get_color;
  iface->get_settings = gtk_style_cascade_get_settings;
  iface->get_scale = gtk_style_cascade_get_scale;
  iface->get_keyframes = gtk_style_cascade_get_keyframes;
  iface->lookup = gtk_style_cascade_lookup;
}

G_DEFINE_TYPE_EXTENDED (GtkStyleCascade, _gtk_style_cascade, G_TYPE_OBJECT, 0,
                        G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER,
                                               gtk_style_cascade_provider_iface_init)
                        G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER_PRIVATE,
                                               gtk_style_cascade_provider_private_iface_init));

static void
gtk_style_cascade_dispose (GObject *object)
{
  GtkStyleCascade *cascade = GTK_STYLE_CASCADE (object);

  _gtk_style_cascade_set_parent (cascade, NULL);
  g_array_unref (cascade->providers);

  G_OBJECT_CLASS (_gtk_style_cascade_parent_class)->dispose (object);
}

static void
コード例 #13
0
 * Responsible for the ordering of the various contained Clip(s). A
 * timeline layer has a "priority" property, which is used to manage the
 * priorities of individual Clips. Two layers should not have the
 * same priority within a given timeline.
 */

#include "ges-internal.h"
#include "ges-layer.h"
#include "ges.h"
#include "ges-source-clip.h"

static void ges_meta_container_interface_init
    (GESMetaContainerInterface * iface);

G_DEFINE_TYPE_WITH_CODE (GESLayer, ges_layer,
    G_TYPE_INITIALLY_UNOWNED, G_IMPLEMENT_INTERFACE (GES_TYPE_EXTRACTABLE, NULL)
    G_IMPLEMENT_INTERFACE (GES_TYPE_META_CONTAINER,
        ges_meta_container_interface_init));

struct _GESLayerPrivate
{
  /*< private > */
  GList *clips_start;           /* The Clips sorted by start and
                                 * priority */

  guint32 priority;             /* The priority of the layer within the
                                 * containing timeline */
  gboolean auto_transition;
};

typedef struct
コード例 #14
0
ファイル: pkg-graph-2d.c プロジェクト: chergert/graph-hack
/**
 * SECTION:pkg-graph-2d
 * @title: PkgGraph2d
 * @short_description: 
 *
 * Section overview.
 */

static void pkg_graph_init (PkgGraphIface *iface);

G_DEFINE_TYPE_EXTENDED(PkgGraph2d,
                       pkg_graph_2d,
                       CLUTTER_TYPE_GROUP,
                       0,
                       G_IMPLEMENT_INTERFACE(PKG_TYPE_GRAPH,
                                             pkg_graph_init))

struct _PkgGraph2dPrivate
{
	ClutterActor *texture;
	ClutterActor *renderer;
	PkgScale     *x_scale;
	PkgScale     *y_scale;
	gdouble       x_padding;
	gdouble       y_padding;
	gchar        *x_label;
	gchar        *y_label;
};

/**
 * pkg_graph_2d_new:
コード例 #15
0
ファイル: gtktoolbutton.c プロジェクト: raja651/gtk
  gchar *label_text;
  GtkWidget *label_widget;
  GtkWidget *icon_widget;

  GtkSizeGroup *text_size_group;

  guint use_underline : 1;
  guint contents_invalid : 1;
};

static GtkActivatableIface *parent_activatable_iface;
static guint                toolbutton_signals[LAST_SIGNAL] = { 0 };

G_GNUC_BEGIN_IGNORE_DEPRECATIONS
G_DEFINE_TYPE_WITH_CODE (GtkToolButton, gtk_tool_button, GTK_TYPE_TOOL_ITEM,
                         G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIONABLE, gtk_tool_button_actionable_iface_init)
                         G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE, gtk_tool_button_activatable_interface_init))
G_GNUC_END_IGNORE_DEPRECATIONS

static void
gtk_tool_button_class_init (GtkToolButtonClass *klass)
{
  GObjectClass *object_class;
  GtkWidgetClass *widget_class;
  GtkToolItemClass *tool_item_class;

  object_class = (GObjectClass *)klass;
  widget_class = (GtkWidgetClass *)klass;
  tool_item_class = (GtkToolItemClass *)klass;

  object_class->set_property = gtk_tool_button_set_property;
コード例 #16
0
  gpointer start_address;
};

static void gum_gcc_backtracer_iface_init (gpointer g_iface,
    gpointer iface_data);
static void gum_gcc_backtracer_generate (GumBacktracer * backtracer,
    const GumCpuContext * cpu_context,
    GumReturnAddressArray * return_addresses);
static _Unwind_Reason_Code gum_gcc_backtracer_append_address (
    struct _Unwind_Context * context, void * user_data);

G_DEFINE_TYPE_EXTENDED (GumGccBacktracer,
                        gum_gcc_backtracer,
                        G_TYPE_OBJECT,
                        0,
                        G_IMPLEMENT_INTERFACE (GUM_TYPE_BACKTRACER,
                                               gum_gcc_backtracer_iface_init));

static void
gum_gcc_backtracer_class_init (GumGccBacktracerClass * klass)
{
}

static void
gum_gcc_backtracer_iface_init (gpointer g_iface,
                                   gpointer iface_data)
{
  GumBacktracerIface * iface = (GumBacktracerIface *) g_iface;

  iface->generate = gum_gcc_backtracer_generate;
}
コード例 #17
0
ファイル: gtr-po.c プロジェクト: GNOME/gtranslator
  /* Autosave timeout timer */
  guint autosave_timeout;

  /* Header object */
  GtrHeader *header;

  GtrPoState state;

  /* Marks if the file was changed;  */
  guint file_changed : 1;
} GtrPoPrivate;


G_DEFINE_TYPE_WITH_CODE (GtrPo, gtr_po, G_TYPE_OBJECT,
                         G_ADD_PRIVATE (GtrPo)
                         G_IMPLEMENT_INTERFACE (GTR_TYPE_MESSAGE_CONTAINER,
                                                gtr_po_message_container_init))

enum
{
  PROP_0,
  PROP_LOCATION,
  PROP_STATE
};

static gchar *message_error = NULL;

static void
gtr_po_set_property (GObject      *object,
                     guint         prop_id,
                     const GValue *value,
                     GParamSpec   *pspec)
コード例 #18
0
ファイル: gtkframe.c プロジェクト: gtk/gtk
static void gtk_frame_buildable_init                (GtkBuildableIface *iface);
static void gtk_frame_buildable_add_child           (GtkBuildable *buildable,
						     GtkBuilder   *builder,
						     GObject      *child,
						     const gchar  *type);

static void gtk_frame_extended_layout_init (GtkExtendedLayoutIface *iface);
static void gtk_frame_get_desired_width    (GtkExtendedLayout      *layout,
                                            gint                   *minimum_size,
                                            gint                   *natural_size);
static void gtk_frame_get_desired_height   (GtkExtendedLayout      *layout,
                                            gint                   *minimum_size,
                                            gint                   *natural_size);

G_DEFINE_TYPE_WITH_CODE (GtkFrame, gtk_frame, GTK_TYPE_BIN,
			 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
						gtk_frame_buildable_init)
                         G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT,
                                                gtk_frame_extended_layout_init))

static void
gtk_frame_class_init (GtkFrameClass *class)
{
  GObjectClass *gobject_class;
  GtkWidgetClass *widget_class;
  GtkContainerClass *container_class;

  gobject_class = (GObjectClass*) class;
  widget_class = GTK_WIDGET_CLASS (class);
  container_class = GTK_CONTAINER_CLASS (class);

  gobject_class->set_property = gtk_frame_set_property;
コード例 #19
0
ファイル: gtklevelbar.c プロジェクト: Therzok/gtk
  GtkCssNode *trough_node;
  GtkCssNode **block_node;
  guint n_blocks;

  guint inverted : 1;
};

static void gtk_level_bar_set_value_internal (GtkLevelBar *self,
                                              gdouble      value);

static void gtk_level_bar_buildable_init (GtkBuildableIface *iface);

G_DEFINE_TYPE_WITH_CODE (GtkLevelBar, gtk_level_bar, GTK_TYPE_WIDGET,
                         G_ADD_PRIVATE (GtkLevelBar)
                         G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL)
                         G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
                                                gtk_level_bar_buildable_init))

static GtkLevelBarOffset *
gtk_level_bar_offset_new (const gchar *name,
                          gdouble      value)
{
  GtkLevelBarOffset *offset = g_slice_new0 (GtkLevelBarOffset);

  offset->name = g_strdup (name);
  offset->value = value;

  return offset;
}
コード例 #20
0
 *
 * Copyright (C) 2008 - 2009 Novell, Inc.
 * Copyright (C) 2009 Red Hat, Inc.
 */

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "mm-modem-nokia.h"
#include "mm-serial-parsers.h"

static void modem_init (MMModem *modem_class);

G_DEFINE_TYPE_EXTENDED (MMModemNokia, mm_modem_nokia, MM_TYPE_GENERIC_GSM, 0,
                        G_IMPLEMENT_INTERFACE (MM_TYPE_MODEM, modem_init))


MMModem *
mm_modem_nokia_new (const char *device,
                    const char *driver,
                    const char *plugin)
{
    g_return_val_if_fail (device != NULL, NULL);
    g_return_val_if_fail (driver != NULL, NULL);
    g_return_val_if_fail (plugin != NULL, NULL);

    return MM_MODEM (g_object_new (MM_TYPE_MODEM_NOKIA,
                                   MM_MODEM_MASTER_DEVICE, device,
                                   MM_MODEM_DRIVER, driver,
                                   MM_MODEM_PLUGIN, plugin,
コード例 #21
0
ファイル: clutter-alpha.c プロジェクト: Distrotech/clutter
  PROP_TIMELINE,
  PROP_ALPHA,
  PROP_MODE,

  PROP_LAST
};

static GParamSpec *obj_props[PROP_LAST];

static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);

G_DEFINE_TYPE_WITH_CODE (ClutterAlpha,
                         clutter_alpha,
                         G_TYPE_INITIALLY_UNOWNED,
                         G_ADD_PRIVATE (ClutterAlpha)
                         G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE,
                                                clutter_scriptable_iface_init));

static void
timeline_new_frame_cb (ClutterTimeline *timeline,
                       guint            msecs,
                       ClutterAlpha    *alpha)
{
  ClutterAlphaPrivate *priv = alpha->priv;

  /* Update alpha value and notify */
  priv->alpha = clutter_alpha_get_alpha (alpha);
  g_object_notify_by_pspec (G_OBJECT (alpha), obj_props[PROP_ALPHA]);
}

static void 
clutter_alpha_set_property (GObject      *object, 
コード例 #22
0
					GtkTreeIter *parent);
static gboolean _is_store_iter_has_child(GtkTreeModel *tree_model,
					 GtkTreeIter *iter);
static gint _is_store_iter_n_children(GtkTreeModel *tree_model,
				      GtkTreeIter *iter);
static gboolean _is_store_iter_nth_child(GtkTreeModel *tree_model,
					 GtkTreeIter *iter,
					 GtkTreeIter *parent,
					 gint n);
static gboolean _is_store_iter_parent(GtkTreeModel *tree_model,
				      GtkTreeIter *iter,
				      GtkTreeIter *child);

G_DEFINE_TYPE_EXTENDED(IsStore, is_store, G_TYPE_OBJECT,
		       0,
		       G_IMPLEMENT_INTERFACE(GTK_TYPE_TREE_MODEL,
					     is_store_tree_model_init));

typedef struct _IsStoreEntry IsStoreEntry;

struct _IsStoreEntry
{
	/* entry a path name and other entries, and a
	   sensor + enabled value if it is a leaf sensor */
	gchar *name;

	GSequence *entries;

	IsSensor *sensor;
	gboolean enabled;

	/* bookkeeping */
コード例 #23
0
ファイル: goat-dataset-store.c プロジェクト: drahnr/goatplot
#include "goat-dataset-store.h"

typedef struct {
	GtkTreeModel *tree_model;
	gint x_index;
	gint y_index;
	gint ystddev_index;
	gchar *color; // TODO move to GdkRGBA, but need to figure out GValue handling
	GoatMarkerStyle marker_style;
} GoatDatasetStorePrivate;

static void goat_dataset_store_interface_init (GoatDatasetInterface *iface);

G_DEFINE_TYPE_WITH_CODE (GoatDatasetStore, goat_dataset_store, G_TYPE_OBJECT,
                         G_IMPLEMENT_INTERFACE (GOAT_TYPE_DATASET, goat_dataset_store_interface_init)
                             G_ADD_PRIVATE (GoatDatasetStore))

enum {
	PROP_0,

	PROP_TREE_MODEL,
	PROP_X_INDEX,
	PROP_Y_INDEX,
	PROP_YSTDDEV_INDEX,
	PROP_MARKER_STYLE,
	PROP_COLOR,

	N_PROPS
};

static GParamSpec *obj_properties[N_PROPS];
コード例 #24
0
  EggStateMachine *state_machine;
  gpointer         object;
  gchar           *property;
  GValue           value;
} EggStateProperty;

typedef struct
{
  EggStateMachine *state_machine;
  GtkWidget       *widget;
  gchar           *name;
} EggStateStyle;

G_DEFINE_TYPE_WITH_CODE (EggStateMachine, egg_state_machine, G_TYPE_OBJECT,
                         G_ADD_PRIVATE (EggStateMachine)
                         G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
                                                egg_state_machine_buildable_iface_init))

enum {
  PROP_0,
  PROP_STATE,
  LAST_PROP
};

static GParamSpec *properties [LAST_PROP];

static void
egg_state_machine__property_object_weak_notify (gpointer  data,
                                                GObject  *where_object_was)
{
  EggStateProperty *state_prop = data;
  EggStateMachine *self = state_prop->state_machine;
コード例 #25
0
static gboolean impl_ifcfgrh_get_ifcfg_details (SCPluginIfcfg *plugin,
        const char *in_ifcfg,
        const char **out_uuid,
        const char **out_path,
        GError **error);

#include "nm-ifcfg-rh-glue.h"

static void connection_new_or_changed (SCPluginIfcfg *plugin,
                                       const char *path,
                                       NMIfcfgConnection *existing);

static void system_config_interface_init (NMSystemConfigInterface *system_config_interface_class);

G_DEFINE_TYPE_EXTENDED (SCPluginIfcfg, sc_plugin_ifcfg, G_TYPE_OBJECT, 0,
                        G_IMPLEMENT_INTERFACE (NM_TYPE_SYSTEM_CONFIG_INTERFACE,
                                system_config_interface_init))

#define SC_PLUGIN_IFCFG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfgPrivate))


typedef struct {
    GHashTable *connections;

    gulong ih_event_id;
    int sc_network_wd;
    char *hostname;

    GFileMonitor *monitor;
    guint monitor_id;

    DBusGConnection *bus;
コード例 #26
0
static void
ethos_js_plugin_loader_base_init (EthosPluginLoaderIface *iface)
{
	iface->get_name   = get_name;
	iface->gc         = gc;
	iface->initialize = initialize;
	iface->unload     = unload;
	iface->load       = ethos_js_plugin_loader_load;
	iface->register_plugin = register_plugin;
}

G_DEFINE_TYPE_EXTENDED (EthosJSPluginLoader,
                        ethos_js_plugin_loader,
                        G_TYPE_OBJECT,
                        0,
                        G_IMPLEMENT_INTERFACE (ETHOS_TYPE_PLUGIN_LOADER,
                                               ethos_js_plugin_loader_base_init));

static void
ethos_js_plugin_loader_finalize (GObject *object)
{
	G_OBJECT_CLASS (ethos_js_plugin_loader_parent_class)->finalize (object);
}

static void
ethos_js_plugin_loader_class_init (EthosJSPluginLoaderClass *klass)
{
	GObjectClass *object_class = G_OBJECT_CLASS (klass);
	object_class->finalize = ethos_js_plugin_loader_finalize;
	g_type_class_add_private (object_class, sizeof(EthosJSPluginLoaderPrivate));
}
コード例 #27
0
#include "example-notification-plugin.h"

#define EXAMPLE_NOTIFICATION_PLUGIN_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE (obj, \
                                                                                   EXAMPLE_TYPE_NOTIFICATION_PLUGIN, \
                                                                                   ExampleNotificationPluginPrivate))

struct _ExampleNotificationPluginPrivate
{
  gpointer data;
};

static void example_notification_plugin_notification_plugin_iface_init (HDNotificationPluginIface *iface);

G_DEFINE_DYNAMIC_TYPE_EXTENDED (ExampleNotificationPlugin, example_notification_plugin, G_TYPE_OBJECT, 0,
                                G_IMPLEMENT_INTERFACE (HD_TYPE_NOTIFICATION_PLUGIN,
                                                       example_notification_plugin_notification_plugin_iface_init));
HD_PLUGIN_MODULE_SYMBOLS (example_notification_plugin);

static void
example_notification_plugin_notification_closed (HDNotification *notification,
                                                 HDNotificationPlugin *plugin)
{
  g_debug ("ExampleNotificationPlugin::close");
  g_debug ("  ID: %u", hd_notification_get_id (notification));
}

static void
example_notification_plugin_notify (HDNotificationPlugin  *plugin,
                                    HDNotification        *notification)
{
  g_debug ("ExampleNotificationPlugin::notify");
コード例 #28
0
ファイル: gth-file-store.c プロジェクト: GNOME/gthumb
	GList               *queue;
	GthFileDataCompFunc  cmp_func;
	gboolean             inverse_sort : 1;
	gboolean             update_filter : 1;
};


static void gtk_tree_model_interface_init (GtkTreeModelIface *iface);
static void gtk_tree_drag_source_interface_init (GtkTreeDragSourceIface *iface);


G_DEFINE_TYPE_WITH_CODE (GthFileStore,
			 gth_file_store,
			 G_TYPE_OBJECT,
			 G_ADD_PRIVATE (GthFileStore)
			 G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
						gtk_tree_model_interface_init)
			 G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_DRAG_SOURCE,
						gtk_tree_drag_source_interface_init))


static GthFileRow *
_gth_file_row_new (void)
{
	GthFileRow *row;

	row = g_new0 (GthFileRow, 1);
	row->ref_count = 1;

	return row;
}
コード例 #29
0
} DragDataGetInfo;

typedef struct FileEntry FileEntry;

struct FileEntry {
	AthenaFile *file;
	GHashTable *reverse_map;	/* map from files to GSequenceIter's */
	AthenaDirectory *subdirectory;
	FileEntry *parent;
	GSequence *files;
	GSequenceIter *ptr;
	guint loaded : 1;
};

G_DEFINE_TYPE_WITH_CODE (AthenaListModel, athena_list_model, G_TYPE_OBJECT,
			 G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
						athena_list_model_tree_model_init)
			 G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_SORTABLE,
						athena_list_model_sortable_init)
			 G_IMPLEMENT_INTERFACE (EGG_TYPE_TREE_MULTI_DRAG_SOURCE,
						athena_list_model_multi_drag_source_init));

static const GtkTargetEntry drag_types [] = {
	{ ATHENA_ICON_DND_GNOME_ICON_LIST_TYPE, 0, ATHENA_ICON_DND_GNOME_ICON_LIST },
	{ ATHENA_ICON_DND_URI_LIST_TYPE, 0, ATHENA_ICON_DND_URI_LIST },
};

static GtkTargetList *drag_target_list = NULL;

static void
file_entry_free (FileEntry *file_entry)
{
コード例 #30
0
ファイル: gtkimagemenuitem.c プロジェクト: GYGit/gtk
static void gtk_image_menu_item_screen_changed       (GtkWidget       *widget,
                                                      GdkScreen       *previous_screen);

static void gtk_image_menu_item_recalculate          (GtkImageMenuItem *image_menu_item);

static void gtk_image_menu_item_activatable_interface_init (GtkActivatableIface  *iface);
static void gtk_image_menu_item_update                     (GtkActivatable       *activatable,
                                                            GtkAction            *action,
                                                            const gchar          *property_name);
static void gtk_image_menu_item_sync_action_properties     (GtkActivatable       *activatable,
                                                            GtkAction            *action);


G_DEFINE_TYPE_WITH_CODE (GtkImageMenuItem, gtk_image_menu_item, GTK_TYPE_MENU_ITEM,
                         G_ADD_PRIVATE (GtkImageMenuItem)
                         G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE,
                                                gtk_image_menu_item_activatable_interface_init))


static void
gtk_image_menu_item_class_init (GtkImageMenuItemClass *klass)
{
  GObjectClass *gobject_class = (GObjectClass*) klass;
  GtkWidgetClass *widget_class = (GtkWidgetClass*) klass;
  GtkMenuItemClass *menu_item_class = (GtkMenuItemClass*) klass;
  GtkContainerClass *container_class = (GtkContainerClass*) klass;

  widget_class->destroy = gtk_image_menu_item_destroy;
  widget_class->screen_changed = gtk_image_menu_item_screen_changed;
  widget_class->get_preferred_width = gtk_image_menu_item_get_preferred_width;
  widget_class->get_preferred_height = gtk_image_menu_item_get_preferred_height;
  widget_class->get_preferred_height_for_width = gtk_image_menu_item_get_preferred_height_for_width;