Compare commits

...

3 Commits

Author SHA1 Message Date
Romain de Laage da73ac6ff0
Fix links (variable now stay accessible) 2021-02-14 16:59:31 +01:00
Romain de Laage 05393d854b
Change asciiart 2021-02-14 16:46:43 +01:00
Romain de Laage 4ac8cc78d7
Add gnome ascii art 2021-02-14 16:42:20 +01:00
4 changed files with 81 additions and 3 deletions

View File

@ -15,3 +15,67 @@ All the source code is on my self hosted Gitea instance.
* I'm not a Gtk professionnal, my program might be incorrect
* You can't register on my Gitea, you must send me your patch by email (you can use romain.delaage@rdelaage.ovh)
```
,▄▄███████▄
,▄████▄ ,▄█████████████
████████▄ ▓███████████████
╓▄╓ ▐████████▌ .████████████████▀
██████p ║████████M ████████████████▀
║███████ ▐████████ ▐███████████████
║███████ ▀██████ ▐█████████████└
,▄▄▄ ███████ ▀███▀ ██████████▀-
▓█████▄ ▀████▀ ▀█████▀└
███████⌐ ▀▀└
╙██████▌ ,▄▄▄▄▄▄▄█▄▄▄▄▄▄,
▀████▌ ▄▄██████████████████████▄▄
▀▀▀ ▄██████████████████████████████
▄█████████████████████████████████▌
▄███████████████████████████████████▌
╓████████████████████████████████████▀
╓████████████████████████████████████"
██████████████████████████████████▀└
║███████████████████████████████▀╙
║████████████████████████████▀└
████████████████████████▀▀
▀████████████████████▀└
██████████████████▀ ▄▄▄▄██▄▄▄
████████████████ ▄████████████
▀██████████████ ████████████▌
██████████████▄ ╓████████████
"███████████████▄▄▄▄████████████▀
▀███████████████████████████└
╙▀█████████████████████▀└
╙▀██████████████▀└
└"╙╙╙"-
```

View File

@ -2,6 +2,7 @@
#include "../include/gemgui.h"
void linkAction (GtkWidget *widget, gpointer data);
extern char links[1024][20];
void
addH1 (GtkWidget *root,

View File

@ -24,6 +24,7 @@ int parseFile (char *path);
#else
extern GtkWidget *render;
extern char links[1024][20];
#endif
@ -32,6 +33,9 @@ parseFile (char *path)
{
FILE *fileToParse = fopen (path, "r");
char line[4096];
#ifndef TESTGEMPARSE
int linkNumber = 0;
#endif
if (fileToParse == NULL)
{
@ -125,12 +129,16 @@ parseFile (char *path)
while (beginText < size && line[beginText] == ' ')
beginText++;
#ifndef TESTGEMPARSE
strcpy (links[linkNumber], line + beginUrl);
#endif
//If not text, text = url
if (beginText == size)
#ifdef TESTGEMPARSE
addLink (line + beginUrl, line + beginUrl);
addLink (line + beginUrl, links[linkNumber]);
#else
addLink (render, line + beginUrl, line + beginUrl);
addLink (render, links[linkNumber], links[linkNumber]);
#endif
else
{
@ -140,9 +148,13 @@ parseFile (char *path)
#ifdef TESTGEMPARSE
addLink (line + beginUrl, line + beginText);
#else
addLink (render, line + beginUrl, line + beginText);
addLink (render, links[linkNumber], line + beginText);
#endif
}
#ifndef TESTGEMPARSE
linkNumber++;
#endif
}
else if (size > 3 && line[0] == '`' && line[1] == '`' && line[2] == '`')
{

View File

@ -5,6 +5,7 @@
GtkEntryBuffer *pathBarContent = NULL;
GtkWidget *render = NULL;
GtkWidget *scrollbar = NULL;
char links[1024][20];
static void
loadPage (const char *link)