Lines Matching refs:hdata

65 static HistItemData *hist_item_data_ref (HistItemData *hdata);
66 static void hist_item_data_unref (HistItemData *hdata);
114 static void focus_on_hist_data (QueryEditor *editor, HistItemData *hdata);
115 static HistItemData *get_next_hist_data (QueryEditor *editor, HistItemData *hdata);
116 static HistItemData *get_prev_hist_data (QueryEditor *editor, HistItemData *hdata);
622 HistItemData *hdata; in text_view_draw() local
625 hdata = g_hash_table_lookup (editor->priv->hash, list->data); in text_view_draw()
626 gtk_text_buffer_get_iter_at_mark (tbuffer, &cur, hdata->end_mark); in text_view_draw()
1183 focus_on_hist_data (QueryEditor *editor, HistItemData *hdata) in focus_on_hist_data() argument
1186 if (editor->priv->hist_focus == hdata) in focus_on_hist_data()
1205 if (hdata) { in focus_on_hist_data()
1212 editor->priv->hist_focus = hist_item_data_ref (hdata); in focus_on_hist_data()
1213 if (hdata->item) in focus_on_hist_data()
1214 g_object_set (G_OBJECT (hdata->tag), in focus_on_hist_data()
1219 for (list = hdata->batch->hist_items; list; list = list->next) { in focus_on_hist_data()
1227 gtk_text_buffer_get_iter_at_mark (buffer, &iter, hdata->start_mark); in focus_on_hist_data()
1229 gtk_text_view_scroll_mark_onscreen (GTK_TEXT_VIEW (editor->priv->text), hdata->start_mark); in focus_on_hist_data()
1286 HistItemData *hdata; in query_editor_start_history_batch() local
1311 hdata = hist_item_data_new (); in query_editor_start_history_batch()
1312 hdata->batch = query_editor_history_batch_ref (hist_batch); in query_editor_start_history_batch()
1313 hdata->item = NULL; in query_editor_start_history_batch()
1314 g_hash_table_insert (editor->priv->hash, hist_batch, hdata); in query_editor_start_history_batch()
1320 hdata->start_mark = gtk_text_buffer_create_mark (buffer, NULL, &iter, TRUE); in query_editor_start_history_batch()
1328 hdata->tag = g_object_ref (tag); in query_editor_start_history_batch()
1329 g_hash_table_insert (editor->priv->hash, tag, hist_item_data_ref (hdata)); in query_editor_start_history_batch()
1339 hdata->end_mark = gtk_text_buffer_create_mark (buffer, NULL, &iter, TRUE); in query_editor_start_history_batch()
1370 HistItemData *hdata; in timestamps_update_cb() local
1371 hdata = g_hash_table_lookup (editor->priv->hash, batch); in timestamps_update_cb()
1374 gtk_text_buffer_get_iter_at_mark (buffer, &start, hdata->start_mark); in timestamps_update_cb()
1375 gtk_text_buffer_get_iter_at_mark (buffer, &end, hdata->end_mark); in timestamps_update_cb()
1379 gtk_text_buffer_get_iter_at_mark (buffer, &start, hdata->start_mark); in timestamps_update_cb()
1382 -1, hdata->tag, NULL); in timestamps_update_cb()
1383 gtk_text_buffer_delete_mark (buffer, hdata->end_mark); in timestamps_update_cb()
1384 hdata->end_mark = gtk_text_buffer_create_mark (buffer, NULL, &start, TRUE); in timestamps_update_cb()
1406 HistItemData *hdata; in query_editor_add_history_item() local
1414 hdata = hist_item_data_new (); in query_editor_add_history_item()
1415 hdata->batch = NULL; in query_editor_add_history_item()
1416 hdata->item = query_editor_history_item_ref (hist_item); in query_editor_add_history_item()
1417 g_hash_table_insert (editor->priv->hash, hist_item, hdata); in query_editor_add_history_item()
1426 hdata->batch = query_editor_history_batch_ref (editor->priv->insert_into_batch); in query_editor_add_history_item()
1438 hdata->tag = g_object_ref (tag); in query_editor_add_history_item()
1439 g_hash_table_insert (editor->priv->hash, tag, hist_item_data_ref (hdata)); in query_editor_add_history_item()
1442 hdata->start_mark = gtk_text_buffer_create_mark (buffer, NULL, &iter, TRUE); in query_editor_add_history_item()
1458 hdata->end_mark = gtk_text_buffer_create_mark (buffer, NULL, &iter, TRUE); in query_editor_add_history_item()
1460 focus_on_hist_data (editor, hdata); in query_editor_add_history_item()
1539 HistItemData *hdata, *focus; in query_editor_del_current_history_item() local
1547 hdata = editor->priv->hist_focus; in query_editor_del_current_history_item()
1548 if (!hdata->item) in query_editor_del_current_history_item()
1551 focus = get_next_hist_data (editor, hdata); in query_editor_del_current_history_item()
1555 focus_on_hist_data (editor, get_prev_hist_data (editor, hdata)); in query_editor_del_current_history_item()
1561 gtk_text_buffer_get_iter_at_mark (buffer, &start, hdata->start_mark); in query_editor_del_current_history_item()
1562 gtk_text_buffer_get_iter_at_mark (buffer, &end, hdata->end_mark); in query_editor_del_current_history_item()
1564 gtk_text_buffer_delete_mark (buffer, hdata->start_mark); in query_editor_del_current_history_item()
1565 gtk_text_buffer_delete_mark (buffer, hdata->end_mark); in query_editor_del_current_history_item()
1567 hist_item_data_ref (hdata); in query_editor_del_current_history_item()
1568 g_hash_table_remove (editor->priv->hash, hdata->item); in query_editor_del_current_history_item()
1569 g_hash_table_remove (editor->priv->hash, hdata->tag); in query_editor_del_current_history_item()
1571 g_assert (hdata->batch); in query_editor_del_current_history_item()
1572 query_editor_history_batch_del_item (editor, hdata->batch, hdata->item); in query_editor_del_current_history_item()
1574 if (! hdata->batch->hist_items) { in query_editor_del_current_history_item()
1578 editor->priv->batches_list = g_slist_remove (editor->priv->batches_list, hdata->batch); in query_editor_del_current_history_item()
1579 query_editor_history_batch_unref (hdata->batch); in query_editor_del_current_history_item()
1581 remhdata = g_hash_table_lookup (editor->priv->hash, hdata->batch); in query_editor_del_current_history_item()
1591 if (editor->priv->insert_into_batch == hdata->batch) { in query_editor_del_current_history_item()
1596 hist_item_data_unref (hdata); in query_editor_del_current_history_item()
1639 HistItemData *hdata; in query_editor_del_history_batch() local
1662 hdata = g_hash_table_lookup (editor->priv->hash, list->data); in query_editor_del_history_batch()
1663 g_assert (hdata); in query_editor_del_history_batch()
1665 gtk_text_buffer_get_iter_at_mark (buffer, &start, hdata->start_mark); in query_editor_del_history_batch()
1666 gtk_text_buffer_get_iter_at_mark (buffer, &end, hdata->end_mark); in query_editor_del_history_batch()
1668 gtk_text_buffer_delete_mark (buffer, hdata->start_mark); in query_editor_del_history_batch()
1669 gtk_text_buffer_delete_mark (buffer, hdata->end_mark); in query_editor_del_history_batch()
1671 g_hash_table_remove (editor->priv->hash, hdata->item); in query_editor_del_history_batch()
1672 g_hash_table_remove (editor->priv->hash, hdata->tag); in query_editor_del_history_batch()
1680 hdata = g_hash_table_lookup (editor->priv->hash, batch); in query_editor_del_history_batch()
1681 gtk_text_buffer_get_iter_at_mark (buffer, &start, hdata->start_mark); in query_editor_del_history_batch()
1682 gtk_text_buffer_get_iter_at_mark (buffer, &end, hdata->end_mark); in query_editor_del_history_batch()
1684 gtk_text_buffer_delete_mark (buffer, hdata->start_mark); in query_editor_del_history_batch()
1685 gtk_text_buffer_delete_mark (buffer, hdata->end_mark); in query_editor_del_history_batch()
1692 g_hash_table_remove (editor->priv->hash, hdata->batch); in query_editor_del_history_batch()
1693 g_hash_table_remove (editor->priv->hash, hdata->tag); in query_editor_del_history_batch()
1697 get_next_hist_data (QueryEditor *editor, HistItemData *hdata) in get_next_hist_data() argument
1700 g_return_val_if_fail (hdata, NULL); in get_next_hist_data()
1701 g_assert (hdata->batch); in get_next_hist_data()
1703 if (hdata->item) { in get_next_hist_data()
1704 node = g_slist_find (hdata->batch->hist_items, hdata->item); in get_next_hist_data()
1711 if (hdata->batch->hist_items) in get_next_hist_data()
1712 return g_hash_table_lookup (editor->priv->hash, hdata->batch->hist_items->data); in get_next_hist_data()
1716 i = g_slist_index (editor->priv->batches_list, hdata->batch); in get_next_hist_data()
1719 hdata = g_hash_table_lookup (editor->priv->hash, node->data); in get_next_hist_data()
1720 return get_next_hist_data (editor, hdata); in get_next_hist_data()
1726 get_prev_hist_data (QueryEditor *editor, HistItemData *hdata) in get_prev_hist_data() argument
1730 g_return_val_if_fail (hdata, NULL); in get_prev_hist_data()
1731 g_assert (hdata->batch); in get_prev_hist_data()
1733 if (hdata->item) { in get_prev_hist_data()
1734 node = g_slist_find (hdata->batch->hist_items, hdata->item); in get_prev_hist_data()
1736 i = g_slist_position (hdata->batch->hist_items, node); in get_prev_hist_data()
1738 node = g_slist_nth (hdata->batch->hist_items, i - 1); in get_prev_hist_data()
1744 node = g_slist_find (editor->priv->batches_list, hdata->batch); in get_prev_hist_data()
2031 HistItemData *hdata; in hist_item_data_new() local
2032 hdata = g_new0 (HistItemData, 1); in hist_item_data_new()
2033 hdata->ref_count = 1; in hist_item_data_new()
2034 return hdata; in hist_item_data_new()
2038 hist_item_data_ref (HistItemData *hdata) in hist_item_data_ref() argument
2040 g_return_val_if_fail (hdata, NULL); in hist_item_data_ref()
2041 hdata->ref_count ++; in hist_item_data_ref()
2043 g_print ("%s (%p) ref count:%d\n", __FUNCTION__, hdata, hdata->ref_count); in hist_item_data_ref()
2045 return hdata; in hist_item_data_ref()
2049 hist_item_data_unref (HistItemData *hdata) in hist_item_data_unref() argument
2051 g_return_if_fail (hdata); in hist_item_data_unref()
2052 hdata->ref_count --; in hist_item_data_unref()
2054 g_print ("%s (%p) ref count:%d\n", __FUNCTION__, hdata, hdata->ref_count); in hist_item_data_unref()
2056 if (hdata->ref_count <= 0) { in hist_item_data_unref()
2057 if (hdata->batch) in hist_item_data_unref()
2058 query_editor_history_batch_unref (hdata->batch); in hist_item_data_unref()
2059 if (hdata->item) in hist_item_data_unref()
2060 query_editor_history_item_unref (hdata->item); in hist_item_data_unref()
2061 if (hdata->tag) in hist_item_data_unref()
2062 g_object_unref (hdata->tag); in hist_item_data_unref()
2063 g_free (hdata); in hist_item_data_unref()