本文整理汇总了C++中GET_PRIV函数的典型用法代码示例。如果您正苦于以下问题:C++ GET_PRIV函数的具体用法?C++ GET_PRIV怎么用?C++ GET_PRIV使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GET_PRIV函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: empathy_connection_managers_prepare_async
void
empathy_connection_managers_prepare_async (
EmpathyConnectionManagers *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
EmpathyConnectionManagersPriv *priv = GET_PRIV (self);
GSimpleAsyncResult *result;
result = g_simple_async_result_new (G_OBJECT (managers),
callback, user_data, empathy_connection_managers_prepare_finish);
if (priv->ready)
{
g_simple_async_result_complete_in_idle (result);
g_object_unref (result);
return;
}
g_signal_connect (self, "notify::ready", G_CALLBACK (notify_ready_cb),
result);
}
示例2: empathy_connection_managers_dispose
static void
empathy_connection_managers_dispose (GObject *object)
{
EmpathyConnectionManagers *self = EMPATHY_CONNECTION_MANAGERS (object);
EmpathyConnectionManagersPriv *priv = GET_PRIV (self);
if (priv->dispose_has_run)
return;
priv->dispose_has_run = TRUE;
if (priv->dbus != NULL)
g_object_unref (priv->dbus);
priv->dbus = NULL;
empathy_connection_managers_free_cm_list (self);
/* release any references held by the object here */
if (G_OBJECT_CLASS (empathy_connection_managers_parent_class)->dispose)
G_OBJECT_CLASS (empathy_connection_managers_parent_class)->dispose (object);
}
示例3: clicked_cb
static void
clicked_cb (GtkButton *button,
gpointer user_data)
{
EmpathyIrcNetworkChooserPriv *priv = GET_PRIV (button);
GtkWindow *window;
if (priv->dialog != NULL)
goto out;
window = empathy_get_toplevel_window (GTK_WIDGET (button));
priv->dialog = empathy_irc_network_chooser_dialog_new (priv->settings,
priv->network, window);
gtk_widget_show_all (priv->dialog);
tp_g_signal_connect_object (priv->dialog, "response",
G_CALLBACK (dialog_response_cb), button, 0);
out:
empathy_window_present (GTK_WINDOW (priv->dialog));
}
示例4: gossip_cell_renderer_expander_get_size
static void
gossip_cell_renderer_expander_get_size (GtkCellRenderer *cell,
GtkWidget *widget,
GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
gint *width,
gint *height)
{
GossipCellRendererExpander *expander;
GossipCellRendererExpanderPriv *priv;
expander = (GossipCellRendererExpander*) cell;
priv = GET_PRIV (expander);
if (cell_area) {
if (x_offset) {
*x_offset = cell->xalign * (cell_area->width - (priv->expander_size + (2 * cell->xpad)));
*x_offset = MAX (*x_offset, 0);
}
if (y_offset) {
*y_offset = cell->yalign * (cell_area->height - (priv->expander_size + (2 * cell->ypad)));
*y_offset = MAX (*y_offset, 0);
}
} else {
if (x_offset)
*x_offset = 0;
if (y_offset)
*y_offset = 0;
}
if (width)
*width = cell->xpad * 2 + priv->expander_size;
if (height)
*height = cell->ypad * 2 + priv->expander_size;
}
示例5: empathy_call_handler_request_cb
static void
empathy_call_handler_request_cb (EmpathyDispatchOperation *operation,
const GError *error, gpointer user_data)
{
EmpathyCallHandler *self = EMPATHY_CALL_HANDLER (user_data);
EmpathyCallHandlerPriv *priv = GET_PRIV (self);
if (error != NULL)
return;
priv->call = EMPATHY_TP_CALL (
empathy_dispatch_operation_get_channel_wrapper (operation));
g_object_ref (priv->call);
empathy_call_handler_start_tpfs (self);
empathy_tp_call_to (priv->call, priv->contact,
priv->initial_audio, priv->initial_video);
empathy_dispatch_operation_claim (operation);
}
示例6: tp_contact_list_remove_from_group
static void
tp_contact_list_remove_from_group (EmpathyContactList *list,
EmpathyContact *contact,
const gchar *group_name)
{
EmpathyTpContactListPriv *priv = GET_PRIV (list);
TpChannel *channel;
TpHandle handle;
GArray handles = {(gchar *) &handle, 1};
channel = g_hash_table_lookup (priv->groups, group_name);
if (channel == NULL) {
return;
}
handle = empathy_contact_get_handle (contact);
DEBUG ("remove contact %s (%d) from group %s",
empathy_contact_get_id (contact), handle, group_name);
tp_cli_channel_interface_group_call_remove_members (channel, -1,
&handles, NULL, NULL, NULL, NULL, NULL);
}
示例7: ft_manager_delete_event_cb
static gboolean
ft_manager_delete_event_cb (GtkWidget *widget,
GdkEvent *event,
EmpathyFTManager *manager)
{
EmpathyFTManagerPriv *priv = GET_PRIV (manager);
DEBUG ("%p", manager);
/* remove all the completed/cancelled/errored transfers */
ft_manager_clear (manager);
if (g_hash_table_size (priv->ft_handler_to_row_ref) > 0)
{
/* There is still FTs on flight, just hide the window */
DEBUG ("Hiding window");
gtk_widget_hide (widget);
return TRUE;
}
return FALSE;
}
示例8: presence_chooser_finalize
static void
presence_chooser_finalize (GObject *object)
{
EmpathyPresenceChooserPriv *priv;
priv = GET_PRIV (object);
if (priv->flash_timeout_id) {
g_source_remove (priv->flash_timeout_id);
}
if (priv->focus_out_idle_source) {
g_source_remove (priv->focus_out_idle_source);
}
g_signal_handlers_disconnect_by_func (priv->idle,
presence_chooser_presence_changed_cb,
object);
g_object_unref (priv->idle);
G_OBJECT_CLASS (empathy_presence_chooser_parent_class)->finalize (object);
}
示例9: tp_contact_list_group_add_channel
static void
tp_contact_list_group_add_channel (EmpathyTpContactList *list,
const gchar *object_path,
GHashTable *properties)
{
EmpathyTpContactListPriv *priv = GET_PRIV (list);
TpChannel *channel;
GError *error = NULL;
channel = tp_channel_new_from_properties (priv->connection,
object_path, properties, &error);
if (channel == NULL) {
DEBUG ("Failed to create group channel: %s", error->message);
g_error_free (error);
return;
}
/* Give the ref to the callback */
tp_channel_call_when_ready (channel,
tp_contact_list_group_ready_cb,
list);
}
示例10: remove_from_member_if_needed
static void
remove_from_member_if_needed (EmpathyTpContactList *list,
TpHandle handle)
{
/* remove contact from members if it's not in publish and subscribe */
EmpathyTpContactListPriv *priv = GET_PRIV (list);
const TpIntSet *members;
members = tp_channel_group_get_members (priv->subscribe);
if (tp_intset_is_member (members, handle))
return;
members = tp_channel_group_get_remote_pending (priv->subscribe);
if (tp_intset_is_member (members, handle))
return;
members = tp_channel_group_get_members (priv->publish);
if (tp_intset_is_member (members, handle))
return;
tp_contact_list_remove_handle (list, priv->members, handle);
}
示例11: handle_toplevel_configure
/* We handle configure events on the toplevel in order to
* reposition our window when the toplevel moves.
*/
static gboolean
handle_toplevel_configure(GtkWidget *toplevel,
GdkEventConfigure *event,
GtkWidget *widget)
{
MozWebViewPriv *priv;
gint x, y;
priv = GET_PRIV(widget);
DBG(g_print("Configure event !\n"));
gdk_window_get_position(widget->window, &x, &y);
x += widget->allocation.x;
y += widget->allocation.y;
SetWindowPos(priv->native_window, NULL, x, y,
widget->allocation.width, widget->allocation.height,
SWP_NOACTIVATE | SWP_NOZORDER);
return FALSE;
}
示例12: preferences_theme_variants_setup
static void
preferences_theme_variants_setup (EmpathyPreferences *preferences)
{
EmpathyPreferencesPriv *priv = GET_PRIV (preferences);
GtkComboBox *combo;
GtkCellLayout *cell_layout;
GtkCellRenderer *renderer;
GtkListStore *store;
combo = GTK_COMBO_BOX (priv->combobox_chat_theme_variant);
cell_layout = GTK_CELL_LAYOUT (combo);
/* Create the model */
store = gtk_list_store_new (COL_VARIANT_COUNT,
G_TYPE_STRING, /* name */
G_TYPE_BOOLEAN); /* is default */
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
COL_VARIANT_NAME, GTK_SORT_ASCENDING);
/* Add cell renderer */
renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (cell_layout, renderer, TRUE);
gtk_cell_layout_set_attributes (cell_layout, renderer,
"text", COL_VARIANT_NAME, NULL);
gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store));
g_object_unref (store);
g_signal_connect (combo, "changed",
G_CALLBACK (preferences_theme_variant_changed_cb),
preferences);
/* Track changes of the GSetting key */
g_signal_connect (priv->gsettings_chat,
"changed::" EMPATHY_PREFS_CHAT_THEME_VARIANT,
G_CALLBACK (preferences_theme_variant_notify_cb),
preferences);
}
示例13: contact_list_view_set_list_features
static void
contact_list_view_set_list_features (EmpathyContactListView *view,
EmpathyContactListFeatureFlags features)
{
EmpathyContactListViewPriv *priv = GET_PRIV (view);
gboolean has_tooltip;
g_return_if_fail (EMPATHY_IS_CONTACT_LIST_VIEW (view));
priv->list_features = features;
/* Update DnD source/dest */
if (features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_DRAG) {
gtk_drag_source_set (GTK_WIDGET (view),
GDK_BUTTON1_MASK,
drag_types_source,
G_N_ELEMENTS (drag_types_source),
GDK_ACTION_MOVE | GDK_ACTION_COPY);
} else {
gtk_drag_source_unset (GTK_WIDGET (view));
}
if (features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_DROP) {
gtk_drag_dest_set (GTK_WIDGET (view),
GTK_DEST_DEFAULT_ALL,
drag_types_dest,
G_N_ELEMENTS (drag_types_dest),
GDK_ACTION_MOVE | GDK_ACTION_COPY);
} else {
/* FIXME: URI could still be droped depending on FT feature */
gtk_drag_dest_unset (GTK_WIDGET (view));
}
/* Update has-tooltip */
has_tooltip = (features & EMPATHY_CONTACT_LIST_FEATURE_CONTACT_TOOLTIP) != 0;
gtk_widget_set_has_tooltip (GTK_WIDGET (view), has_tooltip);
}
示例14: megaphone_applet_update_contact
static void
megaphone_applet_update_contact (MegaphoneApplet *applet)
{
MegaphoneAppletPriv *priv = GET_PRIV (applet);
const gchar *name;
const gchar *status;
gchar *tip;
const gchar *avatar_token = NULL;
if (priv->contact) {
EmpathyAvatar *avatar;
avatar = empathy_contact_get_avatar (priv->contact);
if (avatar) {
avatar_token = avatar->token;
}
}
if (avatar_token) {
panel_applet_gconf_set_string (PANEL_APPLET (applet),
"avatar_token", avatar_token,
NULL);
}
megaphone_applet_update_icon (applet);
if (priv->contact ) {
name = empathy_contact_get_name (priv->contact);
status = empathy_contact_get_status (priv->contact);
tip = g_strdup_printf ("<b>%s</b>: %s", name, status);
gtk_widget_set_tooltip_markup (GTK_WIDGET (applet), tip);
g_free (tip);
} else {
gtk_widget_set_tooltip_markup (GTK_WIDGET (applet),
_("Please configure a contact."));
}
}
示例15: vcl_json
static unsigned int
vcl_json(struct http_request *request, const char *arg, void *data)
{
struct agent_core_t *core = data;
struct vcl_priv_t *vcl;
struct ipc_ret_t vret;
struct vsb *json;
struct http_response *resp;
GET_PRIV(core, vcl);
assert(STARTS_WITH(request->url, "/vcljson"));
assert(request->method == M_GET);
if (arg) {
http_reply(request->connection, 404,
"/vcljson takes no argument");
return (0);
}
ipc_run(vcl->vadmin, &vret, "vcl.list");
if (vret.status == 400)
http_reply(request->connection, 500, vret.answer);
else {
json = vcl_list_json(vret.answer);
assert(VSB_finish(json) == 0);
resp = http_mkresp(request->connection, 200, NULL);
resp->data = VSB_data(json);
resp->ndata = VSB_len(json);
http_add_header(resp, "Content-Type", "application/json");
send_response(resp);
http_free_resp(resp);
VSB_clear(json);
VSB_delete(json);
}
free(vret.answer);
return (0);
}