本文整理汇总了C++中G_TYPE_INSTANCE_GET_PRIVATE函数的典型用法代码示例。如果您正苦于以下问题:C++ G_TYPE_INSTANCE_GET_PRIVATE函数的具体用法?C++ G_TYPE_INSTANCE_GET_PRIVATE怎么用?C++ G_TYPE_INSTANCE_GET_PRIVATE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了G_TYPE_INSTANCE_GET_PRIVATE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gcal_editable_init
static void gcal_editable_init (GcalEditable *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
GCAL_TYPE_EDITABLE,
GcalEditablePrivate);
}
示例2: gth_reorder_task_init
static void
gth_reorder_task_init (GthReorderTask *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_REORDER_TASK, GthReorderTaskPrivate);
}
示例3: cc_privacy_panel_init
static void
cc_privacy_panel_init (CcPrivacyPanel *self)
{
GError *error;
GtkWidget *widget;
GtkWidget *frame;
guint res;
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, CC_TYPE_PRIVACY_PANEL, CcPrivacyPanelPrivate);
g_resources_register (cc_privacy_get_resource ());
self->priv->builder = gtk_builder_new ();
error = NULL;
res = gtk_builder_add_from_resource (self->priv->builder,
"/org/gnome/control-center/privacy/privacy.ui",
&error);
if (res == 0)
{
g_warning ("Could not load interface file: %s",
(error != NULL) ? error->message : "unknown error");
g_clear_error (&error);
return;
}
self->priv->recent_dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "recent_dialog"));
self->priv->screen_lock_dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "screen_lock_dialog"));
self->priv->trash_dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "trash_dialog"));
self->priv->software_dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "software_dialog"));
self->priv->abrt_dialog = GTK_WIDGET (gtk_builder_get_object (self->priv->builder, "abrt_dialog"));
frame = WID ("frame");
widget = gtk_list_box_new ();
gtk_list_box_set_selection_mode (GTK_LIST_BOX (widget), GTK_SELECTION_NONE);
gtk_container_add (GTK_CONTAINER (frame), widget);
self->priv->list_box = widget;
gtk_widget_show (widget);
g_signal_connect_swapped (widget, "row-activated",
G_CALLBACK (activate_row), self);
gtk_list_box_set_header_func (GTK_LIST_BOX (widget),
cc_list_box_update_header_func,
NULL, NULL);
self->priv->lockdown_settings = g_settings_new ("org.gnome.desktop.lockdown");
self->priv->lock_settings = g_settings_new ("org.gnome.desktop.screensaver");
self->priv->privacy_settings = g_settings_new ("org.gnome.desktop.privacy");
self->priv->notification_settings = g_settings_new ("org.gnome.desktop.notifications");
self->priv->location_settings = g_settings_new ("org.gnome.system.location");
add_screen_lock (self);
add_usage_history (self);
add_trash_temp (self);
add_software (self);
add_abrt (self);
g_signal_connect (self->priv->lockdown_settings, "changed",
G_CALLBACK (on_lockdown_settings_changed), self);
update_lock_screen_sensitivity (self);
widget = WID ("location_services_switch");
gtk_switch_set_active (GTK_SWITCH (widget),
g_settings_get_boolean (self->priv->location_settings,
LOCATION_ENABLED));
g_settings_bind (self->priv->location_settings,
LOCATION_ENABLED,
widget, "active",
G_SETTINGS_BIND_DEFAULT);
widget = WID ("privacy_vbox");
gtk_container_add (GTK_CONTAINER (self), widget);
}
示例4: is_sensor_dialog_init
static void
is_sensor_dialog_init(IsSensorDialog *self)
{
IsSensorDialogPrivate *priv;
GtkWidget *label, *low_label, *high_label, *grid;
self->priv = priv =
G_TYPE_INSTANCE_GET_PRIVATE(self, IS_TYPE_SENSOR_DIALOG,
IsSensorDialogPrivate);
gtk_window_set_title(GTK_WINDOW(self), _(PACKAGE_NAME " Sensor Properties"));
gtk_window_set_default_size(GTK_WINDOW(self), 250, 0);
gtk_dialog_add_button(GTK_DIALOG(self),
GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT);
/* pack content into box */
grid = gtk_grid_new();
gtk_grid_set_column_spacing(GTK_GRID(grid), 6);
gtk_grid_set_row_spacing(GTK_GRID(grid), 6);
gtk_container_set_border_width(GTK_CONTAINER(grid), 6);
priv->path_label = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(priv->path_label), 0.0, 0.5);
gtk_grid_attach(GTK_GRID(grid), priv->path_label,
0, 0,
4, 1);
label = gtk_label_new(_("Label"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
gtk_grid_attach(GTK_GRID(grid), label,
0, 1,
1, 1);
priv->label_entry = gtk_entry_new();
gtk_grid_attach(GTK_GRID(grid), priv->label_entry,
1, 1,
3, 1);
label = gtk_label_new(_("Alarm"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
gtk_grid_attach(GTK_GRID(grid), label,
0, 2,
1, 1);
priv->alarm_mode_combo_box = gtk_combo_box_text_new();
gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(priv->alarm_mode_combo_box),
IS_SENSOR_ALARM_MODE_DISABLED,
_("Disabled"));
gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(priv->alarm_mode_combo_box),
IS_SENSOR_ALARM_MODE_LOW,
_("Below"));
gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(priv->alarm_mode_combo_box),
IS_SENSOR_ALARM_MODE_HIGH,
_("Above"));
gtk_widget_set_sensitive(priv->alarm_mode_combo_box, FALSE);
gtk_grid_attach(GTK_GRID(grid), priv->alarm_mode_combo_box,
1, 2,
1, 1);
priv->alarm_value_spin_button = gtk_spin_button_new_with_range(-MAX_VALUE,
MAX_VALUE,
1.0f);
gtk_widget_set_sensitive(priv->alarm_value_spin_button, FALSE);
gtk_grid_attach(GTK_GRID(grid), priv->alarm_value_spin_button,
2, 2,
1, 1);
priv->units_label = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(priv->units_label), 0.0, 0.5);
gtk_grid_attach(GTK_GRID(grid), priv->units_label,
3, 2,
1, 1);
low_label = gtk_label_new(_("Low value"));
gtk_misc_set_alignment(GTK_MISC(low_label), 0.0, 0.5);
gtk_grid_attach(GTK_GRID(grid), low_label,
0, 3,
1, 1);
priv->low_value = gtk_spin_button_new_with_range(-MAX_VALUE,
MAX_VALUE,
1.0f);
gtk_grid_attach(GTK_GRID(grid), priv->low_value,
1, 3,
1, 1);
priv->low_units_label = gtk_label_new(NULL);
gtk_misc_set_alignment(GTK_MISC(priv->low_units_label), 0.0, 0.5);
gtk_grid_attach(GTK_GRID(grid), priv->low_units_label,
2, 3,
1, 1);
high_label = gtk_label_new(_("High value"));
gtk_misc_set_alignment(GTK_MISC(high_label), 0.0, 0.5);
gtk_grid_attach(GTK_GRID(grid), high_label,
0, 4,
1, 1);
priv->high_value = gtk_spin_button_new_with_range(-MAX_VALUE,
MAX_VALUE,
1.0f);
gtk_grid_attach(GTK_GRID(grid), priv->high_value,
1, 4,
1, 1);
//.........这里部分代码省略.........
示例5: gst_device_init
static void
gst_device_init (GstDevice * device)
{
device->priv = G_TYPE_INSTANCE_GET_PRIVATE (device, GST_TYPE_DEVICE,
GstDevicePrivate);
}
示例6: ges_effect_init
static void
ges_effect_init (GESEffect * self)
{
self->priv =
G_TYPE_INSTANCE_GET_PRIVATE (self, GES_TYPE_EFFECT, GESEffectPrivate);
}
示例7: qq_chatwindow_init
static void qq_chatwindow_init(QQChatWindow *win)
{
QQChatWindowPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE(win
, qq_chatwindow_get_type()
, QQChatWindowPriv);
gchar buf[500];
priv -> body_vbox = gtk_vbox_new(FALSE, 0);
GtkWidget *header_hbox = gtk_hbox_new(FALSE, 0);
GtkWidget *vbox = gtk_vbox_new(FALSE, 0);
QQBuddy *bdy = qq_info_lookup_buddy_by_uin(info, priv -> uin);
GdkPixbuf *pb = NULL;
g_snprintf(buf, 500, IMGDIR"%s", "avatar.gif");
pb = gdk_pixbuf_new_from_file(buf, NULL);
gtk_window_set_icon(GTK_WINDOW(win), pb);
g_object_unref(pb);
g_snprintf(buf, 500, "Talking with %s", bdy == NULL ? priv -> uin
: bdy -> nick -> str);
gtk_window_set_title(GTK_WINDOW(win), buf);
//create header
g_snprintf(buf, 500, IMGDIR"%s", "avatar.gif");
pb= gdk_pixbuf_new_from_file_at_size(buf, 35, 35, NULL);
priv -> faceimage = gtk_image_new_from_pixbuf(pb);
g_object_unref(pb);
priv -> name_label = gtk_label_new("");
priv -> lnick_label = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(header_hbox), priv -> faceimage
, FALSE, FALSE, 5);
gtk_box_pack_start(GTK_BOX(vbox), priv -> name_label, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), priv -> lnick_label, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(header_hbox), vbox, FALSE, FALSE, 5);
gtk_box_pack_start(GTK_BOX(priv -> body_vbox), header_hbox
, FALSE, FALSE, 5);
// message text view
priv -> chat_widget = qq_chatwidget_new();
gtk_box_pack_start(GTK_BOX(priv -> body_vbox), priv -> chat_widget
, TRUE, TRUE, 0);
// buttons
GtkWidget *buttonbox = gtk_hbutton_box_new();
gtk_button_box_set_layout(GTK_BUTTON_BOX(buttonbox), GTK_BUTTONBOX_END);
gtk_box_set_spacing(GTK_BOX(buttonbox), 5);
priv -> close_btn = gtk_button_new_with_label("Close");
g_signal_connect(G_OBJECT(priv -> close_btn), "clicked",
G_CALLBACK(qq_chatwindow_on_close_clicked), win);
priv -> send_btn = gtk_button_new_with_label("Send");
g_signal_connect(G_OBJECT(priv -> send_btn), "clicked",
G_CALLBACK(qq_chatwindow_on_send_clicked), win);
gtk_container_add(GTK_CONTAINER(buttonbox), priv -> close_btn);
gtk_container_add(GTK_CONTAINER(buttonbox), priv -> send_btn);
gtk_box_pack_start(GTK_BOX(priv -> body_vbox), buttonbox, FALSE, FALSE, 3);
GtkWidget *w = GTK_WIDGET(win);
gtk_window_resize(GTK_WINDOW(w), 500, 450);
gtk_container_add(GTK_CONTAINER(win), priv -> body_vbox);
gtk_widget_show_all(priv -> body_vbox);
gtk_widget_grab_focus(qq_chatwidget_get_input_textview(
priv -> chat_widget));
g_signal_connect(G_OBJECT(win), "delete-event"
, G_CALLBACK(qq_chatwindow_delete_event)
, priv);
g_signal_connect(G_OBJECT(win), "focus-in-event"
, G_CALLBACK(qq_chatwindow_focus_in_event)
, priv);
g_signal_connect(G_OBJECT(win), "key-press-event"
, G_CALLBACK(qq_chatwindow_key_press), priv);
g_signal_connect(G_OBJECT(qq_chatwidget_get_input_textview(
priv -> chat_widget))
, "key-press-event"
, G_CALLBACK(qq_input_textview_key_press), win);
}
示例8: qq_chatwindow_setter
/*
* The setter.
*/
static void qq_chatwindow_setter(GObject *object, guint property_id,
const GValue *value, GParamSpec *pspec)
{
if(object == NULL || value == NULL || property_id < 0){
return;
}
QQChatWindowPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE(
object, qq_chatwindow_get_type()
, QQChatWindowPriv);
gchar buf[500];
GdkPixbuf *pb = NULL;
switch (property_id)
{
case QQ_CHATWINDOW_PROPERTY_UIN:
g_stpcpy(priv -> uin, g_value_get_string(value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
break;
}
QQBuddy *bdy = qq_info_lookup_buddy_by_uin(info, priv -> uin);
gchar *name = priv -> uin;
if(bdy == NULL){
return;
}
// set lnick
g_snprintf(buf, 500, "<b>%s</b>", bdy -> lnick -> str);
gtk_label_set_markup(GTK_LABEL(priv -> lnick_label), buf);
// set face image
g_snprintf(buf, 500, "%s/%s", QQ_FACEDIR, bdy -> qqnumber -> str);
pb= gdk_pixbuf_new_from_file_at_size(buf, 35, 35, NULL);
if(pb == NULL){
pb= gdk_pixbuf_new_from_file_at_size(IMGDIR"/avatar.gif"
, 35, 35, NULL);
}
gtk_image_set_from_pixbuf(GTK_IMAGE(priv -> faceimage), pb);
// window icon
gtk_window_set_icon(GTK_WINDOW(object), pb);
g_object_unref(pb);
if(bdy -> markname == NULL || bdy -> markname -> len <= 0){
name = bdy -> nick -> str;
}else{
name = bdy -> markname -> str;
}
// set status and name
if(g_strcmp0("online", bdy -> status -> str) == 0
|| g_strcmp0("away", bdy -> status -> str) == 0
|| g_strcmp0("busy", bdy -> status -> str) == 0
|| g_strcmp0("silent", bdy -> status -> str) == 0
|| g_strcmp0("callme", bdy -> status -> str) == 0){
gtk_widget_set_sensitive(priv -> faceimage, TRUE);
g_snprintf(buf, 500, "<b>%s</b><span color='blue'>[%s]</span>"
, name
, bdy -> status -> str);
}else{
gtk_widget_set_sensitive(priv -> faceimage, FALSE);
g_snprintf(buf, 500, "<b>%s</b>", name);
}
gtk_label_set_markup(GTK_LABEL(priv -> name_label), buf);
// window title
g_snprintf(buf, 500, "Talking with %s", name);
gtk_window_set_title(GTK_WINDOW(object), buf);
}
示例9: gkm_secret_key_init
static void
gkm_secret_key_init (GkmSecretKey *self)
{
self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, GKM_TYPE_SECRET_KEY, GkmSecretKeyPrivate);
}
示例10: facq_pipeline_monitor_init
static void facq_pipeline_monitor_init(FacqPipelineMonitor *mon)
{
mon->priv = G_TYPE_INSTANCE_GET_PRIVATE(mon,FACQ_TYPE_PIPELINE_MONITOR,FacqPipelineMonitorPrivate);
mon->priv->q = NULL;
mon->priv->source_id = 0;
}
示例11: bastile_pgp_key_init
static void
bastile_pgp_key_init (BastilePgpKey *self)
{
self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, BASTILE_TYPE_PGP_KEY, BastilePgpKeyPrivate);
}
示例12: axing_resolver_init
static void
axing_resolver_init (AxingResolver *resolver)
{
resolver->priv = G_TYPE_INSTANCE_GET_PRIVATE (resolver, AXING_TYPE_RESOLVER,
AxingResolverPrivate);
}
示例13: math_preferences_init
static void
math_preferences_init(MathPreferencesDialog *dialog)
{
dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE(dialog, math_preferences_get_type(), MathPreferencesDialogPrivate);
}
示例14: gm_audio_profiles_edit_init
/* create a dialog widget from scratch */
static void
gm_audio_profiles_edit_init (GMAudioProfilesEdit *dialog)
{
GtkDialog *gdialog = GTK_DIALOG (dialog);
GtkWidget *vbox;
GtkWidget *label;
GtkWidget *sw;
GtkWidget *hbox;
GtkWidget *bbox;
GtkWidget *button;
GtkTreeSelection *selection;
/*
dialog =
gtk_dialog_new_with_buttons (_("Edit Profiles"),
NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_HELP,
GTK_RESPONSE_HELP,
GTK_STOCK_CLOSE,
GTK_RESPONSE_ACCEPT,
NULL);
*/
// FIXME: GTK_DIALOG_DESTROY_WITH_PARENT,
dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog, GM_AUDIO_TYPE_PROFILES_EDIT, GMAudioProfilesEditPrivate);
gtk_window_set_title (GTK_WINDOW (dialog), _("Edit MATE Audio Profiles"));
gtk_window_set_default_size (GTK_WINDOW (dialog), 320, 240);
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
GTK_STOCK_HELP,
GTK_RESPONSE_HELP,
GTK_STOCK_CLOSE,
GTK_RESPONSE_ACCEPT,
NULL);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (gdialog)), 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_action_area (gdialog)), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_action_area (gdialog)), 6);
g_signal_connect (GTK_DIALOG (dialog),
"response",
G_CALLBACK (on_gm_audio_profiles_edit_response),
NULL);
g_signal_connect (G_OBJECT (dialog),
"destroy",
G_CALLBACK (on_gm_audio_profiles_edit_destroy),
NULL);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (gdialog)),
vbox, TRUE, TRUE, 0);
/* FIXME
hbox = gtk_hbox_new (FALSE, PADDING);
gtk_box_pack_end (GTK_BOX (vbox),
hbox, FALSE, FALSE, 0);
app->manage_profiles_default_menu = profile_optionmenu_new ();
g_signal_connect (G_OBJECT (app->manage_profiles_default_menu),
"changed", G_CALLBACK (default_menu_changed),
app);
gtk_box_pack_start (GTK_BOX (hbox),
label, TRUE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (hbox),
app->manage_profiles_default_menu, FALSE, FALSE, 0);
*/
hbox = gtk_hbox_new (FALSE, 6);
label = gtk_label_new_with_mnemonic (_("_Profiles:"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox),
hbox, TRUE, TRUE, 0);
dialog->priv->manage_profiles_list = create_profile_list ();
g_signal_connect (G_OBJECT (dialog->priv->manage_profiles_list),
"row_activated",
G_CALLBACK (profile_activated_callback),
NULL);
sw = gtk_scrolled_window_new (NULL, NULL);
/* FIXME
terminal_util_set_labelled_by (GTK_WIDGET (dialog->priv->manage_profiles_list),
GTK_LABEL (label));
*/
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
GTK_SHADOW_IN);
//.........这里部分代码省略.........
示例15: session_config_init
static void
session_config_init (SessionConfig *config)
{
config->priv = G_TYPE_INSTANCE_GET_PRIVATE (config, SESSION_CONFIG_TYPE, SessionConfigPrivate);
}