From 15d6a1b2f3bf7f517cf983ffe5dfa3f181db339b Mon Sep 17 00:00:00 2001 From: mehmetmertguduz Date: Fri, 7 Jun 2024 20:30:56 +0300 Subject: [PATCH] doxy refresh --- .../d45/create__posts__window_8c_source.html | 2 +- .../create__controls__window_8c_source.html | 2 +- .../d9/d28/create__post__tags__window_8c.html | 12 +- .../d9/d28/create__post__tags__window_8c.js | 2 +- .../create__post__tags__window_8c_source.html | 12 +- docs/html/dc/dec/search_8c_source.html | 112 ++++++++++++++---- docs/html/de/d29/yiffy__search_8h.html | 12 +- docs/html/de/d29/yiffy__search_8h.js | 2 +- docs/html/de/d29/yiffy__search_8h_source.html | 4 +- docs/html/globals.html | 2 +- docs/html/globals_func.html | 2 +- docs/html/navtreeindex0.js | 2 +- docs/html/navtreeindex1.js | 2 +- docs/html/search/all_2.js | 2 +- docs/html/search/functions_1.js | 2 +- src/search/search.c | 1 - 16 files changed, 121 insertions(+), 52 deletions(-) diff --git a/docs/html/d3/d45/create__posts__window_8c_source.html b/docs/html/d3/d45/create__posts__window_8c_source.html index 34be4f9..2969696 100644 --- a/docs/html/d3/d45/create__posts__window_8c_source.html +++ b/docs/html/d3/d45/create__posts__window_8c_source.html @@ -116,7 +116,7 @@
16void create_posts_window(WINDOW **window, int *posts_panel_height)
17{
18 /* Create the posts window until information, taking 12 lines from it because the info and controls window line is 12. */
-
19 *posts_panel_height = LINES - 12;
+
19 *posts_panel_height = LINES - 13;
20
21 *window = newwin(*posts_panel_height, COLS, 3, 0);
22 box(*window, 0, 0);
diff --git a/docs/html/d6/d24/create__controls__window_8c_source.html b/docs/html/d6/d24/create__controls__window_8c_source.html index e909ba7..fcb81db 100644 --- a/docs/html/d6/d24/create__controls__window_8c_source.html +++ b/docs/html/d6/d24/create__controls__window_8c_source.html @@ -115,7 +115,7 @@
12
18void create_controls_window(WINDOW *window, int *posts_panel_height, control *controls, int total_controls)
19{
-
20 window = newwin(3, COLS, 9 + *posts_panel_height, 0);
+
20 window = newwin(3, COLS, 10 + *posts_panel_height, 0);
21 box(window, 0, 0);
22
23 set_window_title(window, "CONTROLS");
diff --git a/docs/html/d9/d28/create__post__tags__window_8c.html b/docs/html/d9/d28/create__post__tags__window_8c.html index 799f030..5773339 100644 --- a/docs/html/d9/d28/create__post__tags__window_8c.html +++ b/docs/html/d9/d28/create__post__tags__window_8c.html @@ -143,9 +143,9 @@ - - - + + +

Functions

void create_post_tags_window (WINDOW *window, int *posts_panel_height)
 Creates a new window to display post tags and adds it to the specified position. More...
 
void create_post_tags_window (WINDOW **window, int *posts_panel_height)
 Creates a new window to display post tags and adds it to the specified position. More...
 

Detailed Description

This file is used to create a new window to display post tags and adds it to the specified position.

@@ -154,8 +154,8 @@

Definition in file create_post_tags_window.c.

Function Documentation

- -

◆ create_post_tags_window()

+ +

◆ create_post_tags_window()

@@ -163,7 +163,7 @@

void create_post_tags_window ( - WINDOW *  + WINDOW **  window, diff --git a/docs/html/d9/d28/create__post__tags__window_8c.js b/docs/html/d9/d28/create__post__tags__window_8c.js index 247cc9a..a7e5c18 100644 --- a/docs/html/d9/d28/create__post__tags__window_8c.js +++ b/docs/html/d9/d28/create__post__tags__window_8c.js @@ -1,4 +1,4 @@ var create__post__tags__window_8c = [ - [ "create_post_tags_window", "d9/d28/create__post__tags__window_8c.html#a800291b89cb5eebec38a251c0ea0a24f", null ] + [ "create_post_tags_window", "d9/d28/create__post__tags__window_8c.html#afa5859b14c57e819f651888724030194", null ] ]; \ No newline at end of file diff --git a/docs/html/d9/d28/create__post__tags__window_8c_source.html b/docs/html/d9/d28/create__post__tags__window_8c_source.html index 11feb7e..e172cdf 100644 --- a/docs/html/d9/d28/create__post__tags__window_8c_source.html +++ b/docs/html/d9/d28/create__post__tags__window_8c_source.html @@ -113,17 +113,17 @@ Go to the documentation of this file.
1
11#include "yiffy_search.h"
12
-
16void create_post_tags_window(WINDOW *window, int *posts_panel_height)
+
16void create_post_tags_window(WINDOW **window, int *posts_panel_height)
17{
-
18 window = newwin(6, COLS, 3 + *posts_panel_height, 0);
-
19 box(window, 0, 0);
+
18 *window = newwin(7, COLS, 3 + *posts_panel_height, 0);
+
19 box(*window, 0, 0);
20
-
21 set_window_title(window, "POST-TAGS");
+
21 set_window_title(*window, "POST-TAGS");
22
23 refresh();
-
24 wrefresh(window);
+
24 wrefresh(*window);
25}
-
void create_post_tags_window(WINDOW *window, int *posts_panel_height)
Creates a new window to display post tags and adds it to the specified position.
+
void create_post_tags_window(WINDOW **window, int *posts_panel_height)
Creates a new window to display post tags and adds it to the specified position.
void set_window_title(WINDOW *window, const char *title)
Writes a title to the top-left corner of the specified window.
This header file is used to handle the fetching and searching system.

diff --git a/docs/html/dc/dec/search_8c_source.html b/docs/html/dc/dec/search_8c_source.html index 2fb11a5..2af7e28 100644 --- a/docs/html/dc/dec/search_8c_source.html +++ b/docs/html/dc/dec/search_8c_source.html @@ -143,7 +143,7 @@
44 /* Create the ncurses-based user interfaces. */
46 create_posts_window(&posts_window, &posts_panel_height);
-
47 create_post_tags_window(post_tags_window, &posts_panel_height);
+
47 create_post_tags_window(&post_tags_window, &posts_panel_height);
48 create_controls_window(controls_window, &posts_panel_height, controls, sizeof(controls) / sizeof(controls[0]));
49
50 /* Download the first page of posts with prompted tags. */
@@ -208,28 +208,97 @@
109 /* Take the url of the of the specified post by parsing the data from file object. */
110 cJSON *url = cJSON_GetObjectItem(file_object, "url");
111
-
112 if (url != NULL && cJSON_IsString(url) && post_i != posts_panel_height - 2)
-
113 {
-
114 write_post(posts_window, post_i, url);
-
115
-
116 wrefresh(posts_window);
-
117
-
118 /* Increase post_i. */
-
119 post_i++;
-
120 }
-
121 }
-
122
-
123 wrefresh(posts_window);
-
124 refresh();
-
125
-
126 END:
-
127 cJSON_Delete(json);
-
128 getch();
-
129 endwin();
-
130}
+
112 if (post_i == 0)
+
113 {
+
114 /* The tags object parsing. */
+
115 cJSON *tags_object = cJSON_GetObjectItem(post, "tags");
+
116
+
117 if (tags_object == NULL)
+
118 {
+
119 fprintf(stderr, "Tags object not found in post %d\n", i);
+
120 goto END;
+
121 }
+
122
+
123 /* The general tags array parsing. */
+
124 cJSON *general_tags = cJSON_GetObjectItem(tags_object, "general");
+
125
+
126 wmove(post_tags_window, 1, 1);
+
127
+
128 int line_counter = 0;
+
129 int max_width = getmaxx(post_tags_window) - 2; // Get the window width, minus 2 for borders
+
130 int max_height = 6; // Fixed height for the window
+
131 int line_to_write = 1;
+
132
+
133 if (cJSON_IsArray(general_tags))
+
134 {
+
135 for (size_t j = 0; j < cJSON_GetArraySize(general_tags); j++)
+
136 {
+
137 cJSON *tag = cJSON_GetArrayItem(general_tags, j);
+
138
+
139 for (size_t k = 0; k < strlen(tag->valuestring); k++)
+
140 {
+
141 if (line_counter >= max_width)
+
142 {
+
143 line_to_write++;
+
144 if (line_to_write >= max_height) // Check for vertical overflow
+
145 {
+
146 break;
+
147 }
+
148 wmove(post_tags_window, line_to_write, 1);
+
149 line_counter = 0;
+
150 }
+
151
+
152 wprintw(post_tags_window, "%c", tag->valuestring[k]);
+
153 wrefresh(post_tags_window);
+
154 line_counter++;
+
155 }
+
156
+
157 if (line_counter + 2 >= max_width) // Check if ", " will overflow
+
158 {
+
159 line_to_write++;
+
160 if (line_to_write >= max_height) // Check for vertical overflow
+
161 {
+
162 break;
+
163 }
+
164 wmove(post_tags_window, line_to_write, 1);
+
165 line_counter = 0;
+
166 }
+
167 else
+
168 {
+
169 wprintw(post_tags_window, ", ");
+
170 line_counter += 2;
+
171 }
+
172
+
173 if (line_to_write >= max_height) // Check for vertical overflow
+
174 {
+
175 break;
+
176 }
+
177 }
+
178 }
+
179 }
+
180
+
181
+
182 if (url != NULL && cJSON_IsString(url) && post_i != posts_panel_height - 2)
+
183 {
+
184 write_post(posts_window, post_i, url);
+
185 wrefresh(posts_window);
+
186
+
187 /* Increase post_i. */
+
188 post_i++;
+
189 }
+
190 }
+
191
+
192 wrefresh(posts_window);
+
193 refresh();
+
194
+
195 END:
+
196 cJSON_Delete(json);
+
197 getch();
+
198 endwin();
+
199}
void aria2_download(char *tags, int page, int lim)
downloads the API response by using aria2c, works with a system call
void create_controls_window(WINDOW *window, int *posts_panel_height, control *controls, int total_controls)
Creates a new window to display the controls and adds it to the specified position.
-
void create_post_tags_window(WINDOW *window, int *posts_panel_height)
Creates a new window to display post tags and adds it to the specified position.
+
void create_post_tags_window(WINDOW **window, int *posts_panel_height)
Creates a new window to display post tags and adds it to the specified position.
void create_posts_window(WINDOW **window, int *posts_panel_height)
Creates a new window to display posts and adds it to the specified position.
void create_top_window(WINDOW *window)
Creates a new top window to display the title and SFW/NSFW status.
void init_ncurses()
Initializes the ncurses library and sets up the terminal UI.
Definition: init_ncurses.c:14
@@ -245,6 +314,7 @@
control controls[]
Definition: search.c:17
#define CONTENT_SIZE
This macro is used to set the default size for reading the JSON file that comes as a response from th...
Definition: search.c:15
Definition: cjson.h:111
+
char * valuestring
Definition: cjson.h:122
Stores the control name and key for displaying in the controls panel.
Definition: yiffy_search.h:23
void write_post(WINDOW *window, size_t post_i, cJSON *url)
Writes posts to the posts window.
Definition: write_post.c:17
This header file is used to handle the fetching and searching system.
diff --git a/docs/html/de/d29/yiffy__search_8h.html b/docs/html/de/d29/yiffy__search_8h.html index 179609b..5a683a7 100644 --- a/docs/html/de/d29/yiffy__search_8h.html +++ b/docs/html/de/d29/yiffy__search_8h.html @@ -182,9 +182,9 @@ void create_posts_window (WINDOW **window, int *posts_panel_height)  Creates a new window to display posts and adds it to the specified position. More...
  -void create_post_tags_window (WINDOW *window, int *posts_panel_height) - Creates a new window to display post tags and adds it to the specified position. More...
-  +void create_post_tags_window (WINDOW **window, int *posts_panel_height) + Creates a new window to display post tags and adds it to the specified position. More...
+  void create_controls_window (WINDOW *window, int *posts_panel_height, control *controls, int total_controls)  Creates a new window to display the controls and adds it to the specified position. More...
  @@ -259,8 +259,8 @@

-

◆ create_post_tags_window()

+ +

◆ create_post_tags_window()

@@ -268,7 +268,7 @@

void create_post_tags_window ( - WINDOW *  + WINDOW **  window, diff --git a/docs/html/de/d29/yiffy__search_8h.js b/docs/html/de/d29/yiffy__search_8h.js index 6d78765..1c97cfc 100644 --- a/docs/html/de/d29/yiffy__search_8h.js +++ b/docs/html/de/d29/yiffy__search_8h.js @@ -2,7 +2,7 @@ var yiffy__search_8h = [ [ "control", "dd/dee/structcontrol.html", "dd/dee/structcontrol" ], [ "create_controls_window", "de/d29/yiffy__search_8h.html#a0a856b187dbd59a65a8bc9ffe5a597b1", null ], - [ "create_post_tags_window", "de/d29/yiffy__search_8h.html#a800291b89cb5eebec38a251c0ea0a24f", null ], + [ "create_post_tags_window", "de/d29/yiffy__search_8h.html#afa5859b14c57e819f651888724030194", null ], [ "create_posts_window", "de/d29/yiffy__search_8h.html#ad1975f63b7ab6049822e7b85a4bd40ee", null ], [ "create_top_window", "de/d29/yiffy__search_8h.html#a5b2a6a6ce54a02a47d025adba6d325d7", null ], [ "init_ncurses", "de/d29/yiffy__search_8h.html#a85769112d75b553ce8125bfda23f32bc", null ], diff --git a/docs/html/de/d29/yiffy__search_8h_source.html b/docs/html/de/d29/yiffy__search_8h_source.html index 33d9864..8c24814 100644 --- a/docs/html/de/d29/yiffy__search_8h_source.html +++ b/docs/html/de/d29/yiffy__search_8h_source.html @@ -136,7 +136,7 @@
34/* User Interface creation functions. */
35void create_top_window(WINDOW *window);
36void create_posts_window(WINDOW **window, int *posts_panel_height);
-
37void create_post_tags_window(WINDOW *window, int *posts_panel_height);
+
37void create_post_tags_window(WINDOW **window, int *posts_panel_height);
38void create_controls_window(WINDOW *window, int *posts_panel_height, control *controls, int total_controls);
39
40/* Function for writing the titles to windows. */
@@ -153,11 +153,11 @@
char control_character
Definition: yiffy_search.h:25
void create_controls_window(WINDOW *window, int *posts_panel_height, control *controls, int total_controls)
Creates a new window to display the controls and adds it to the specified position.
void create_top_window(WINDOW *window)
Creates a new top window to display the title and SFW/NSFW status.
-
void create_post_tags_window(WINDOW *window, int *posts_panel_height)
Creates a new window to display post tags and adds it to the specified position.
void init_ncurses()
Initializes the ncurses library and sets up the terminal UI.
Definition: init_ncurses.c:14
void set_window_title(WINDOW *window, const char *title)
Writes a title to the top-left corner of the specified window.
void search(char *tags)
Creates a ncurses-based user interface to show, download, search and travel the e621/e926 by using cu...
Definition: search.c:39
void create_posts_window(WINDOW **window, int *posts_panel_height)
Creates a new window to display posts and adds it to the specified position.
+
void create_post_tags_window(WINDOW **window, int *posts_panel_height)
Creates a new window to display post tags and adds it to the specified position.
void write_post(WINDOW *window, size_t post_i, cJSON *url)
Writes posts to the posts window.
Definition: write_post.c:17

diff --git a/docs/html/globals.html b/docs/html/globals.html index f12080c..b952878 100644 --- a/docs/html/globals.html +++ b/docs/html/globals.html @@ -172,7 +172,7 @@

- c -