• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ prop_ref_dec函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中prop_ref_dec函数的典型用法代码示例。如果您正苦于以下问题:C++ prop_ref_dec函数的具体用法?C++ prop_ref_dec怎么用?C++ prop_ref_dec使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了prop_ref_dec函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
  }
}
开发者ID:CrashSerious,项目名称:showtime,代码行数:59,代码来源:gu_statusbar.c


示例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);
}
开发者ID:kshostak,项目名称:showtime,代码行数:10,代码来源:event.c


示例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);
}
开发者ID:supersn0b,项目名称:movian,代码行数:11,代码来源:event.c


示例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);
}
开发者ID:Rautz,项目名称:showtime,代码行数:13,代码来源:settings.c


示例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);
}
开发者ID:supersn0b,项目名称:movian,代码行数:7,代码来源:event.c


示例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;
}
开发者ID:Bibamaru,项目名称:showtime,代码行数:25,代码来源:js_page.c


示例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;
}
开发者ID:dev-life,项目名称:showtime,代码行数:34,代码来源:glw.c


示例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;
}
开发者ID:Rautz,项目名称:showtime,代码行数:60,代码来源:httpcontrol.c


示例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);
}
开发者ID:Allba,项目名称:showtime,代码行数:7,代码来源:gu_video.c


示例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);
}
开发者ID:tajmouati,项目名称:showtime,代码行数:33,代码来源:notifications.c


示例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);
}
开发者ID:StingerFG,项目名称:movian,代码行数:31,代码来源:glw_text_bitmap.c


示例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);
}
开发者ID:aznboi665,项目名称:showtime,代码行数:33,代码来源:glw_keyintercept.c


示例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);
}
开发者ID:TELE-TWIN,项目名称:showtime,代码行数:7,代码来源:event.c


示例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);
}
开发者ID:Cy-4AH,项目名称:showtime,代码行数:8,代码来源:prop_jni.c


示例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);
}
开发者ID:kshostak,项目名称:showtime,代码行数:8,代码来源:gu_popup.c


示例16: notify_timeout

static void
notify_timeout(callout_t *c, void *aux)
{
  prop_t *p = aux;
  prop_destroy(p);
  prop_ref_dec(p);
  free(c);
}
开发者ID:Sinster,项目名称:showtime,代码行数:8,代码来源:notifications.c


示例17: mip_release

static void
mip_release(metadb_item_prop_t *mip)
{
  mip->mip_refcount--;
  if(mip->mip_refcount > 0)
    return;

  LIST_REMOVE(mip, mip_link);

  prop_unsubscribe(mip->mip_destroy_sub);
  prop_unsubscribe(mip->mip_playcount_sub);
  prop_ref_dec(mip->mip_playcount);
  prop_ref_dec(mip->mip_lastplayed);
  prop_ref_dec(mip->mip_restartpos);
  free(mip->mip_url);
  free(mip);

}
开发者ID:Overx,项目名称:showtime,代码行数:18,代码来源:playinfo.c


示例18: setting_destroy

void
setting_destroy(setting_t *s)
{
  free(s->s_id);
  prop_unsubscribe(s->s_sub);
  prop_destroy(s->s_root);
  prop_ref_dec(s->s_val);
  free(s);
}
开发者ID:carlinx,项目名称:showtime,代码行数:9,代码来源:settings.c


示例19: item_finalize

static void
item_finalize(JSContext *cx, JSObject *obj)
{
  js_item_t *ji = JS_GetPrivate(cx, obj);
  assert(LIST_FIRST(&ji->ji_event_handlers) == NULL);
  TAILQ_REMOVE(&ji->ji_model->jm_items, ji, ji_link);
  prop_ref_dec(ji->ji_root);
  free(ji);
}
开发者ID:Allba,项目名称:showtime,代码行数:9,代码来源:js_page.c


示例20: event_release

void
event_release(event_t *e)
{
  if(atomic_add(&e->e_refcount, -1) == 1) {
    if(e->e_dtor != NULL)
      e->e_dtor(e);
    prop_ref_dec(e->e_nav);
    free(e);
  }
}
开发者ID:kshostak,项目名称:showtime,代码行数:10,代码来源:event.c



注:本文中的prop_ref_dec函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ prop_ref_inc函数代码示例发布时间:2022-05-30
下一篇:
C++ prop_object_release函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap