63 char **owner_pass = ((
void **)data)[0];
64 char **user_pass = ((
void **)data)[1];
65 GtkWindow *wnd = ((
void **)data)[2];
66 GtkBuilder *password_builder = ((
void **)data)[3];
67 char *
path = ((
void **)data)[4];
72 op = strdup(gtk_entry_get_text(
73 GTK_ENTRY(gtk_builder_get_object(password_builder,
74 "entryPDFOwnerPassword"))));
75 op1 = strdup(gtk_entry_get_text(
76 GTK_ENTRY(gtk_builder_get_object(password_builder,
77 "entryPDFOwnerPassword1"))));
78 up = strdup(gtk_entry_get_text(
79 GTK_ENTRY(gtk_builder_get_object(password_builder,
80 "entryPDFUserPassword"))));
81 up1 = strdup(gtk_entry_get_text(
82 GTK_ENTRY(gtk_builder_get_object(password_builder,
83 "entryPDFUserPassword1"))));
87 gtk_label_set_text(GTK_LABEL(gtk_builder_get_object(password_builder,
89 "Owner password must be at least 1 character long:");
92 }
else if (!strcmp(op, up)) {
93 gtk_label_set_text(GTK_LABEL(gtk_builder_get_object(password_builder,
95 "User and owner passwords must be different:");
98 }
else if (!strcmp(op, op1) && !strcmp(up, up1)) {
107 gtk_widget_destroy(GTK_WIDGET(wnd));
108 g_object_unref(G_OBJECT(password_builder));
114 gtk_label_set_text(GTK_LABEL(gtk_builder_get_object(password_builder,
115 "labelInfo")),
"Passwords not confirmed:");
126 GtkWindow *wnd = ((
void **)data)[2];
127 GtkBuilder *password_builder = ((
void **)data)[3];
128 char *
path = ((
void **)data)[4];
132 gtk_widget_destroy(GTK_WIDGET(wnd));
133 g_object_unref(G_OBJECT(password_builder));
145 GtkBuilder *password_builder;
150 NSLOG(netsurf, INFO,
"Password UI builder init failed");
154 gtk_builder_connect_signals(password_builder, NULL);
156 wnd = GTK_WINDOW(gtk_builder_get_object(password_builder,
159 data = malloc(5 *
sizeof(
void *));
164 data[0] = owner_pass;
167 data[3] = password_builder;
170 ok = GTK_BUTTON(gtk_builder_get_object(password_builder,
171 "buttonPDFSetPassword"));
172 no = GTK_BUTTON(gtk_builder_get_object(password_builder,
173 "buttonPDFNoPassword"));
175 g_signal_connect(G_OBJECT(ok),
"clicked",
177 g_signal_connect(G_OBJECT(no),
"clicked",
180 gtk_widget_show(GTK_WIDGET(wnd));
gboolean nsgtk_show_uri(GdkScreen *screen, const gchar *uri, guint32 timestamp, GError **error)
Compatibility functions for older GTK versions (interface)
nserror save_pdf(const char *path)
nserror
Enumeration of error codes.
@ NSERROR_NO_FETCH_HANDLER
No fetch handler for URL scheme.
nserror nsgtk_cookies_present(const char *search_term)
make the cookie window visible.
nserror nsgtk_warning(const char *warning, const char *detail)
Warn the user of an event.
static void nsgtk_PDF_no_pass(GtkButton *w, gpointer data)
static nserror gui_launch_url(struct nsurl *url)
static struct gui_misc_table misc_table
static void nsgtk_PDF_set_pass(GtkButton *w, gpointer data)
struct gui_misc_table * nsgtk_misc_table
static void nsgtk_pdf_password(char **owner_pass, char **user_pass, char *path)
nserror nsgtk_schedule(int t, void(*callback)(void *p), void *cbctx)
Interface to platform-specific miscellaneous browser operation table.
#define NSLOG(catname, level, logmsg, args...)
const char * messages_get(const char *key)
Fast lookup of a message by key from the standard Messages hash.
Localised message support (interface).
NetSurf URL handling (interface).
const char * nsurl_access(const nsurl *url)
Access a NetSurf URL object as a string.
struct nsurl nsurl
NetSurf URL object.
nserror nsgtk_builder_new_from_resname(const char *resname, GtkBuilder **builder_out)
Create gtk builder object for the named ui resource.
Interface to gtk builtin resource handling.
Interface to utility string handling.
Graphical user interface browser misc function table.
nserror(* schedule)(int t, void(*callback)(void *p), void *p)
Schedule a callback.
static nserror path(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, const float transform[6])
Plots a path.