本文整理汇总了C++中prop_ref_dec函数的典型用法代码示例。如果您正苦于以下问题:C++ prop_ref_dec函数的具体用法?C++ prop_ref_dec怎么用?C++ prop_ref_dec使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了prop_ref_dec函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: notifications_update
static void
notifications_update(void *opaque, prop_event_t event, ...)
{
statusbar_t *sb = opaque;
prop_t *p, *txt;
statusbar_entry_t *sbe;
char *buf;
rstr_t *msg;
int i, l;
va_list ap;
va_start(ap, event);
switch(event) {
case PROP_ADD_CHILD:
p = va_arg(ap, prop_t *);
txt = prop_get_by_name(PNVEC("self", "text"), 1,
PROP_TAG_NAMED_ROOT, p, "self",
NULL);
if(txt != NULL) {
msg = prop_get_string(txt);
if(msg != NULL) {
buf = mystrdupa(rstr_get(msg));
l = strlen(buf);
for(i = 0; i < l; i++)
if(buf[i] < ' ')
buf[i] = ' ';
sbe = calloc(1, sizeof(statusbar_entry_t));
sbe->p = prop_ref_inc(p);
sbe->id = gtk_statusbar_push(GTK_STATUSBAR(sb->bar), sb->ctxid, buf);
LIST_INSERT_HEAD(&sb->entries, sbe, link);
rstr_release(msg);
}
prop_ref_dec(txt);
}
break;
case PROP_DEL_CHILD:
p = va_arg(ap, prop_t *);
LIST_FOREACH(sbe, &sb->entries, link)
if(sbe->p == p)
break;
if(sbe == NULL)
break;
prop_ref_dec(sbe->p);
gtk_statusbar_remove(GTK_STATUSBAR(sb->bar), sb->ctxid, sbe->id);
LIST_REMOVE(sbe, link);
free(sbe);
break;
default:
break;
}
}
示例2: event_openurl_dtor
static void
event_openurl_dtor(event_t *e)
{
event_openurl_t *ou = (void *)e;
prop_ref_dec(ou->origin);
prop_ref_dec(ou->model);
free(ou->url);
free(ou->view);
free(ou->how);
}
示例3: event_openurl_dtor
static void
event_openurl_dtor(event_t *e)
{
event_openurl_t *ou = (void *)e;
prop_ref_dec(ou->item_model);
prop_ref_dec(ou->parent_model);
free(ou->url);
free(ou->view);
free(ou->how);
free(ou->parent_url);
}
示例4: setting_destroy
void
setting_destroy(setting_t *s)
{
s->s_callback = NULL;
free(s->s_id);
free(s->s_initial_value);
free(s->s_first);
prop_unsubscribe(s->s_sub);
prop_destroy(s->s_root);
prop_ref_dec(s->s_val);
prop_ref_dec(s->s_root);
free(s);
}
示例5: event_prop_action_dtor
static void
event_prop_action_dtor(event_t *e)
{
event_prop_action_t *epa = (event_prop_action_t *)e;
prop_ref_dec(epa->p);
rstr_release(epa->action);
}
示例6: js_item_addOptAction
static JSBool
js_item_addOptAction(JSContext *cx, JSObject *obj,
uintN argc, jsval *argv, jsval *rval)
{
js_item_t *ji = JS_GetPrivate(cx, obj);
const char *title;
const char *action;
if (!JS_ConvertArguments(cx, argc, argv, "ss", &title, &action))
return JS_FALSE;
prop_t *p = prop_create_root(NULL);
prop_set_string(prop_create(p, "type"), "action");
prop_set_string(prop_create(prop_create(p, "metadata"), "title"), title);
prop_set_int(prop_create(p, "enabled"), 1);
prop_set_string(prop_create(p, "action"), action);
prop_t *opts = prop_create_r(ji->ji_root, "options");
if(prop_set_parent(p, opts))
prop_destroy(p);
prop_ref_dec(opts);
*rval = JSVAL_VOID;
return JS_TRUE;
}
示例7: top_event_handler
static int
top_event_handler(glw_t *w, void *opaque, glw_signal_t sig, void *extra)
{
event_t *e = extra;
glw_root_t *gr = opaque;
if(sig != GLW_SIGNAL_EVENT_BUBBLE)
return 0;
if(e->e_type_x == EVENT_KEYDESC)
return 0;
if(event_is_action(e, ACTION_ENABLE_SCREENSAVER)) {
gr->gr_screensaver_force_enable = 1;
} else if(event_is_action(e, ACTION_NAV_BACK) ||
event_is_action(e, ACTION_NAV_FWD) ||
event_is_action(e, ACTION_HOME) ||
event_is_action(e, ACTION_PLAYQUEUE) ||
event_is_action(e, ACTION_RELOAD_DATA) ||
event_is_type(e, EVENT_OPENURL)) {
prop_t *p = prop_get_by_name(PNVEC("nav", "eventsink"), 0,
PROP_TAG_ROOT, gr->gr_prop_nav,
NULL);
prop_send_ext_event(p, e);
prop_ref_dec(p);
} else {
event_addref(e);
event_dispatch(e);
}
return 1;
}
示例8: hc_prop
static int
hc_prop(http_connection_t *hc, const char *remain, void *opaque,
http_cmd_t method)
{
htsbuf_queue_t out;
rstr_t *r;
int rval, i;
prop_t *p;
const char *action = http_arg_get_req(hc, "action");
if(remain == NULL)
return 404;
p = prop_from_path(remain);
if(p == NULL)
return 404;
htsbuf_queue_init(&out, 0);
switch(method) {
case HTTP_CMD_GET:
if(action != NULL) {
event_t *e = event_create_action_str(action);
prop_send_ext_event(p, e);
event_release(e);
rval = HTTP_STATUS_OK;
break;
}
r = prop_get_string(p, NULL);
if(r == NULL) {
char **childs = prop_get_name_of_childs(p);
if(childs == NULL) {
rval = HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE;
break;
}
for(i = 0; childs[i] != NULL; i++) {
htsbuf_qprintf(&out, "\t%s\n", childs[i]);
}
} else {
htsbuf_append(&out, rstr_get(r), strlen(rstr_get(r)));
htsbuf_append(&out, "\n", 1);
rstr_release(r);
}
rval = http_send_reply(hc, 0, "text/ascii", NULL, NULL, 0, &out);
break;
default:
rval = HTTP_STATUS_METHOD_NOT_ALLOWED;
break;
}
prop_ref_dec(p);
return rval;
}
示例9: video_destroy
static void
video_destroy(GtkWidget *w, gu_video_t *gv)
{
prop_unsubscribe(gv->gv_status_sub);
prop_ref_dec(gv->gv_closeprop);
free(gv);
}
示例10: news_sink
static void
news_sink(void *opaque, prop_event_t event, ...)
{
prop_t *p = opaque;
event_t *e;
va_list ap;
va_start(ap, event);
switch(event) {
case PROP_DESTROYED:
prop_unsubscribe(va_arg(ap, prop_sub_t *));
prop_ref_dec(p);
break;
case PROP_EXT_EVENT:
e = va_arg(ap, event_t *);
if(event_is_type(e, EVENT_DYNAMIC_ACTION)) {
const event_payload_t *ep = (const event_payload_t *)e;
if(!strcmp(ep->payload, "dismiss")) {
rstr_t *id = prop_get_string(p, "id", NULL);
dismis_news(rstr_get(id));
rstr_release(id);
prop_destroy(opaque);
}
}
break;
default:
break;
}
va_end(ap);
}
示例11: prop_callback
static void
prop_callback(void *opaque, prop_event_t event, ...)
{
glw_text_bitmap_t *gtb = opaque;
const char *caption;
prop_str_type_t type = 0;
va_list ap;
va_start(ap, event);
switch(event) {
case PROP_SET_VOID:
caption = NULL;
break;
case PROP_SET_RSTRING:
caption = rstr_get(va_arg(ap, const rstr_t *));
type = va_arg(ap, prop_str_type_t);
break;
case PROP_VALUE_PROP:
prop_ref_dec(gtb->gtb_p);
gtb->gtb_p = prop_ref_inc(va_arg(ap, prop_t *));
return;
default:
return;
}
caption_set_internal(gtb, caption, type);
}
示例12: prop_callback
static void
prop_callback(void *opaque, prop_event_t event, ...)
{
glw_keyintercept_t *ki = opaque;
const char *str;
prop_t *p;
int c;
va_list ap;
va_start(ap, event);
switch(event) {
case PROP_SET_VOID:
ki->buflen = 0;
str = NULL;
p = va_arg(ap, prop_t *);
break;
case PROP_SET_RSTRING:
str = rstr_get(va_arg(ap, const rstr_t *));
ki->buflen = 0;
while((c = utf8_get(&str)) != 0 && ki->buflen < 64)
ki->buf[ki->buflen++] = c;
p = va_arg(ap, prop_t *);
break;
default:
return;
}
prop_ref_dec(ki->prop);
ki->prop = prop_ref_inc(p);
}
示例13: event_prop_dtor
static void
event_prop_dtor(event_t *e)
{
event_prop_t *ep = (event_prop_t *)e;
prop_ref_dec(ep->p);
free(e);
}
示例14: jni_property_unexport_from_sub
static void
jni_property_unexport_from_sub(jni_subscription_t *js, jni_prop_t *jp)
{
prop_ref_dec(jp->jp_prop);
LIST_REMOVE(jp, jp_sub_link);
RB_REMOVE(&jni_props, jp, jp_link);
free(jp);
}
示例15: popup_destroy
static void
popup_destroy(popup_t *pop)
{
gtk_widget_destroy(pop->win);
prop_ref_dec(pop->p);
LIST_REMOVE(pop, link);
free(pop);
}