예제 #1
0
파일: box.c 프로젝트: aidanholm/luakit
static gint
luaH_box_index(lua_State *L, widget_t *w, luakit_token_t token)
{
    switch(token) {
      LUAKIT_WIDGET_INDEX_COMMON(w)
      LUAKIT_WIDGET_CONTAINER_INDEX_COMMON(w)

      /* push class methods */
      PF_CASE(PACK,         luaH_box_pack)
      PF_CASE(REORDER,      luaH_box_reorder_child)
      /* push boolean properties */
      PB_CASE(HOMOGENEOUS,  gtk_box_get_homogeneous(GTK_BOX(w->widget)))
      /* push string properties */
      PN_CASE(SPACING,      gtk_box_get_spacing(GTK_BOX(w->widget)))

      PS_CASE(BG, g_object_get_data(G_OBJECT(w->widget), "bg"))

      default:
        break;
    }
    return 0;
}
예제 #2
0
파일: box.c 프로젝트: karottenreibe/luapdf
static gint
luaH_box_index(lua_State *L, luapdf_token_t token)
{
    widget_t *w = luaH_checkwidget(L, 1);

    switch(token)
    {
      LUAPDF_WIDGET_INDEX_COMMON
      LUAPDF_WIDGET_CONTAINER_INDEX_COMMON(w)

      /* push class methods */
      PF_CASE(PACK,         luaH_box_pack)
      PF_CASE(REORDER,      luaH_box_reorder_child)
      /* push boolean properties */
      PB_CASE(HOMOGENEOUS,  gtk_box_get_homogeneous(GTK_BOX(w->widget)))
      /* push string properties */
      PN_CASE(SPACING,      gtk_box_get_spacing(GTK_BOX(w->widget)))

      default:
        break;
    }
    return 0;
}