diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-02-12 12:12:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:48:04 -0500 |
commit | 97416e6b011a3c733d07f83073bf12796c7ecc6b (patch) | |
tree | 5784111269a848f62b86fc131aeee06aeae94b92 /source4/gtk/common | |
parent | 42598ada226c2411451a2d9fdae2834e7f6a1e9f (diff) | |
download | samba-97416e6b011a3c733d07f83073bf12796c7ecc6b.tar.gz samba-97416e6b011a3c733d07f83073bf12796c7ecc6b.tar.bz2 samba-97416e6b011a3c733d07f83073bf12796c7ecc6b.zip |
r21297: Remove the GTK+ tools and library from the main repository. They are now maintained separately in bzr at http://people.samba.org/bzr/jelmer/samba-gtk
This also adds some more headers to the list that is installed and a couple of extra #include lines so these
headers can be used externally without problems.
(This used to be commit 07652f65ce7a5b19130f1a27cbf0e1e5fae13454)
Diffstat (limited to 'source4/gtk/common')
-rw-r--r-- | source4/gtk/common/credentials.c | 132 | ||||
-rw-r--r-- | source4/gtk/common/gtk-smb.c | 316 | ||||
-rw-r--r-- | source4/gtk/common/gtk-smb.h | 76 | ||||
-rw-r--r-- | source4/gtk/common/gtk_events.c | 361 | ||||
-rw-r--r-- | source4/gtk/common/select.c | 305 | ||||
-rw-r--r-- | source4/gtk/common/select.h | 84 |
6 files changed, 0 insertions, 1274 deletions
diff --git a/source4/gtk/common/credentials.c b/source4/gtk/common/credentials.c deleted file mode 100644 index 97e71c329c..0000000000 --- a/source4/gtk/common/credentials.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - Unix SMB/CIFS implementation. - - Copyright (C) Jelmer Vernooij 2005 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include "includes.h" -#include "gtk/common/gtk-smb.h" -#include "auth/credentials/credentials.h" - -static void gtk_get_credentials(struct cli_credentials *credentials) -{ - const char *ret; - GtkWidget *dialog; - GtkWidget *label; - GtkWidget *table; - GtkWidget *entry_username; - GtkWidget *entry_password; - GtkWidget *dialog_action_area1; - GtkWidget *cancelbutton1; - GtkWidget *okbutton1; - GtkWidget *anonymous; - const char *username; - - dialog = gtk_dialog_new (); - gtk_window_set_title (GTK_WINDOW (dialog), "Credentials"); - gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); - gtk_window_set_type_hint (GTK_WINDOW (dialog), GDK_WINDOW_TYPE_HINT_DIALOG); - - table = gtk_table_new(4, 2, FALSE); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table); - - label = gtk_label_new ("Username:"); - - gtk_table_attach(GTK_TABLE(table),label,0,1,1,2,GTK_FILL,0,0,0); - - entry_username = gtk_entry_new (); - gtk_table_attach(GTK_TABLE(table),entry_username,1,2,1,2,GTK_FILL,0,0,0); - gtk_entry_set_activates_default (GTK_ENTRY (entry_username), TRUE); - - username = cli_credentials_get_unparsed_name(credentials, credentials); - - if (credentials->username_obtained != CRED_UNINITIALISED && - username) { - gtk_entry_set_text(GTK_ENTRY(entry_username), username); - } - - label = gtk_label_new ("Password:"); - - gtk_table_attach(GTK_TABLE(table),label,0,1,3,4,GTK_FILL,0,0,0); - - entry_password = gtk_entry_new (); - gtk_table_attach(GTK_TABLE(table),entry_password,1,2,3,4,GTK_FILL,0,0,0); - gtk_entry_set_visibility (GTK_ENTRY (entry_password), FALSE); - gtk_entry_set_activates_default (GTK_ENTRY (entry_password), TRUE); - if (credentials->password_obtained != CRED_UNINITIALISED && - credentials->password_obtained != CRED_CALLBACK && - credentials->password) { - gtk_entry_set_text(GTK_ENTRY(entry_password), credentials->password); - } - - anonymous = gtk_check_button_new_with_mnemonic("_Anonymous"); - gtk_table_attach(GTK_TABLE(table),anonymous,0,2,4,5,GTK_FILL,0,0,0); - - dialog_action_area1 = GTK_DIALOG (dialog)->action_area; - gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); - - cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_dialog_add_action_widget (GTK_DIALOG (dialog), cancelbutton1, GTK_RESPONSE_CANCEL); - GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT); - - okbutton1 = gtk_button_new_from_stock ("gtk-ok"); - gtk_dialog_add_action_widget (GTK_DIALOG (dialog), okbutton1, GTK_RESPONSE_OK); - GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT); - - gtk_widget_show_all (dialog); - - switch (gtk_dialog_run (GTK_DIALOG (dialog))) { - case GTK_RESPONSE_OK: - cli_credentials_parse_string(credentials, gtk_entry_get_text(GTK_ENTRY(entry_username)), CRED_CALLBACK_RESULT); - cli_credentials_set_password(credentials, gtk_entry_get_text(GTK_ENTRY(entry_password)), CRED_CALLBACK_RESULT); - - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(anonymous))) { - cli_credentials_set_anonymous(credentials); - } - break; - default: - ret = NULL; - break; - } - - gtk_widget_destroy (dialog); -} - -static const char *gtk_get_username(struct cli_credentials *credentials) -{ - gtk_get_credentials(credentials); - return credentials->username; -} - -static const char *gtk_get_userpassword(struct cli_credentials *credentials) -{ - gtk_get_credentials(credentials); - return credentials->password; -} - -static const char *gtk_get_domain(struct cli_credentials *credentials) -{ - gtk_get_credentials(credentials); - return credentials->domain; -} - -void cli_credentials_set_gtk_callbacks(struct cli_credentials *cred) -{ - cli_credentials_set_username_callback(cred, gtk_get_username); - cli_credentials_set_domain_callback(cred, gtk_get_domain); - cli_credentials_set_password_callback(cred, gtk_get_userpassword); -} diff --git a/source4/gtk/common/gtk-smb.c b/source4/gtk/common/gtk-smb.c deleted file mode 100644 index cb445d8268..0000000000 --- a/source4/gtk/common/gtk-smb.c +++ /dev/null @@ -1,316 +0,0 @@ -/* - Unix SMB/CIFS implementation. - SMB-related GTK+ functions - - Copyright (C) Jelmer Vernooij 2004-2005 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include "includes.h" -#include "gtk/common/gtk-smb.h" -#include "gtk/common/select.h" -#include "version.h" -#include "librpc/rpc/dcerpc.h" -#include "auth/credentials/credentials.h" - -/** - * Dialog error showing a WERROR - */ -void gtk_show_werror(GtkWidget *win, const char *message, WERROR err) -{ - GtkWidget *dialog = gtk_message_dialog_new( GTK_WINDOW(win), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "%s: %s\n", message?message: "Windows error", - win_errstr(err)); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); -} - -/** - * GTK+ dialog showing a NTSTATUS error - */ -void gtk_show_ntstatus(GtkWidget *win, const char *message, NTSTATUS status) -{ - GtkWidget *dialog = gtk_message_dialog_new( GTK_WINDOW(win), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "%s: %s\n", message?message:"Windows error", - nt_errstr(status)); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); -} - -static void on_browse_activate (GtkButton *button, gpointer user_data) -{ - GtkRpcBindingDialog *rbd = user_data; - GtkWidget *shd = gtk_select_host_dialog_new(rbd->sam_pipe); - if(gtk_dialog_run(GTK_DIALOG(shd)) == GTK_RESPONSE_ACCEPT) { - gtk_entry_set_text(GTK_ENTRY(rbd->entry_host), gtk_select_host_dialog_get_host(GTK_SELECT_HOST_DIALOG(shd))); - } - - gtk_widget_destroy(GTK_WIDGET(shd)); -} - -static void on_ncalrpc_toggled(GtkToggleButton *tb, GtkRpcBindingDialog *d) -{ - gtk_widget_set_sensitive(d->frame_host, !gtk_toggle_button_get_active(tb)); -} - -static void gtk_rpc_binding_dialog_init (GtkRpcBindingDialog *gtk_rpc_binding_dialog) -{ - GtkWidget *dialog_vbox1; - GtkWidget *vbox1; - GtkWidget *vbox6; - GtkWidget *frame_transport; - GtkWidget *label1; - GtkWidget *hbox1; - GtkWidget *lbl_name; - GtkWidget *label2; - GtkWidget *label3; - GtkWidget *frame_security; - GtkWidget *vbox2; - GtkWidget *btn_browse; - GtkWidget *dialog_action_area1; - GtkWidget *btn_cancel; - GtkWidget *btn_connect; - GSList *transport_smb_group = NULL; - - gtk_rpc_binding_dialog->mem_ctx = talloc_init("gtk_rcp_binding_dialog"); - - gtk_window_set_title (GTK_WINDOW (gtk_rpc_binding_dialog), "Connect"); - - dialog_vbox1 = GTK_DIALOG (gtk_rpc_binding_dialog)->vbox; - - vbox1 = gtk_vbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox1, TRUE, TRUE, 0); - - frame_transport = gtk_frame_new (NULL); - gtk_box_pack_start (GTK_BOX (vbox1), frame_transport, TRUE, TRUE, 0); - - vbox6 = gtk_vbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (frame_transport), vbox6); - - gtk_rpc_binding_dialog->transport_ncalrpc = gtk_radio_button_new_with_mnemonic (NULL, "Local Host"); - gtk_box_pack_start (GTK_BOX (vbox6), gtk_rpc_binding_dialog->transport_ncalrpc, FALSE, FALSE, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (gtk_rpc_binding_dialog->transport_ncalrpc), transport_smb_group); - transport_smb_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (gtk_rpc_binding_dialog->transport_ncalrpc)); - - - gtk_rpc_binding_dialog->transport_smb = gtk_radio_button_new_with_mnemonic (NULL, "RPC over SMB over TCP/IP"); - gtk_box_pack_start (GTK_BOX (vbox6), gtk_rpc_binding_dialog->transport_smb, FALSE, FALSE, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (gtk_rpc_binding_dialog->transport_smb), transport_smb_group); - transport_smb_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (gtk_rpc_binding_dialog->transport_smb)); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_rpc_binding_dialog->transport_smb), TRUE); - - gtk_rpc_binding_dialog->transport_tcp_ip = gtk_radio_button_new_with_mnemonic (NULL, "RPC over TCP/IP"); - gtk_box_pack_start (GTK_BOX (vbox6), gtk_rpc_binding_dialog->transport_tcp_ip, FALSE, FALSE, 0); - gtk_radio_button_set_group (GTK_RADIO_BUTTON (gtk_rpc_binding_dialog->transport_tcp_ip), transport_smb_group); - transport_smb_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (gtk_rpc_binding_dialog->transport_tcp_ip)); - - label1 = gtk_label_new ("Transport"); - gtk_frame_set_label_widget (GTK_FRAME (frame_transport), label1); - - gtk_rpc_binding_dialog->frame_host = gtk_frame_new (NULL); - gtk_box_pack_start (GTK_BOX (vbox1), gtk_rpc_binding_dialog->frame_host, TRUE, TRUE, 0); - - hbox1 = gtk_hbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (gtk_rpc_binding_dialog->frame_host), hbox1); - - lbl_name = gtk_label_new ("Name"); - gtk_box_pack_start (GTK_BOX (hbox1), lbl_name, TRUE, TRUE, 0); - - gtk_rpc_binding_dialog->entry_host = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (hbox1), gtk_rpc_binding_dialog->entry_host, TRUE, TRUE, 0); - - if(gtk_rpc_binding_dialog->sam_pipe) - { - btn_browse = gtk_button_new_with_label ("Browse"); - gtk_box_pack_start (GTK_BOX (hbox1), btn_browse, TRUE, TRUE, 0); - - g_signal_connect ((gpointer) btn_browse, "pressed", - G_CALLBACK (on_browse_activate), - gtk_rpc_binding_dialog); - } - - label2 = gtk_label_new ("Host"); - gtk_frame_set_label_widget (GTK_FRAME (gtk_rpc_binding_dialog->frame_host), label2); - - frame_security = gtk_frame_new (NULL); - - label3 = gtk_label_new ("Security"); - gtk_frame_set_label_widget (GTK_FRAME (frame_security), label3); - - gtk_box_pack_start (GTK_BOX (vbox1), frame_security, TRUE, TRUE, 0); - - vbox2 = gtk_vbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (frame_security), vbox2); - - gtk_rpc_binding_dialog->chk_sign = gtk_check_button_new_with_mnemonic ("S_ign"); - gtk_box_pack_start (GTK_BOX (vbox2), gtk_rpc_binding_dialog->chk_sign, FALSE, FALSE, 0); - - gtk_rpc_binding_dialog->chk_seal = gtk_check_button_new_with_mnemonic ("_Seal"); - gtk_box_pack_start (GTK_BOX (vbox2), gtk_rpc_binding_dialog->chk_seal, FALSE, FALSE, 0); - - dialog_action_area1 = GTK_DIALOG (gtk_rpc_binding_dialog)->action_area; - gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); - - btn_cancel = gtk_button_new_from_stock ("gtk-cancel"); - gtk_dialog_add_action_widget (GTK_DIALOG (gtk_rpc_binding_dialog), btn_cancel, GTK_RESPONSE_CANCEL); - GTK_WIDGET_SET_FLAGS (btn_cancel, GTK_CAN_DEFAULT); - - btn_connect = gtk_button_new_with_mnemonic ("C_onnect"); - gtk_dialog_add_action_widget (GTK_DIALOG (gtk_rpc_binding_dialog), btn_connect, GTK_RESPONSE_ACCEPT); - gtk_container_set_border_width (GTK_CONTAINER (btn_connect), 1); - GTK_WIDGET_SET_FLAGS (btn_connect, GTK_CAN_DEFAULT); - - g_signal_connect ((gpointer) gtk_rpc_binding_dialog->transport_ncalrpc, "toggled", - G_CALLBACK (on_ncalrpc_toggled), - gtk_rpc_binding_dialog); - - - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(gtk_rpc_binding_dialog->transport_ncalrpc), TRUE); - gtk_widget_show_all(dialog_vbox1); - - gtk_widget_grab_focus (btn_connect); - gtk_widget_grab_default (btn_connect); -} - -GType gtk_rpc_binding_dialog_get_type (void) -{ - static GType mytype = 0; - - if (!mytype) - { - static const GTypeInfo myinfo = - { - sizeof (GtkRpcBindingDialogClass), - NULL, - NULL, - NULL, - NULL, - NULL, - sizeof(GtkRpcBindingDialog), - 0, - (GInstanceInitFunc) gtk_rpc_binding_dialog_init, - }; - - mytype = g_type_register_static (GTK_TYPE_DIALOG, - "GtkRpcBindingDialog", &myinfo, 0); - } - - return mytype; -} - -/** - * Create a new GTK+ dialog asking for binding information for - * DCE/RPC - * - * Optionally gets a sam pipe that will be used to look up users - */ -GtkWidget *gtk_rpc_binding_dialog_new (struct dcerpc_pipe *sam_pipe) -{ - GtkRpcBindingDialog *d = GTK_RPC_BINDING_DIALOG ( g_object_new (gtk_rpc_binding_dialog_get_type (), NULL)); - d->sam_pipe = sam_pipe; - return GTK_WIDGET(d); -} - -const char *gtk_rpc_binding_dialog_get_host(GtkRpcBindingDialog *d) -{ - return gtk_entry_get_text(GTK_ENTRY(d->entry_host)); -} - -struct dcerpc_binding *gtk_rpc_binding_dialog_get_binding(GtkRpcBindingDialog *d, TALLOC_CTX *mem_ctx) -{ - struct dcerpc_binding *binding = talloc(mem_ctx, struct dcerpc_binding); - - ZERO_STRUCT(binding->object); - - /* Format: TRANSPORT:host[\pipe\foo,foo,foo] */ - - binding->host = talloc_strdup(mem_ctx, gtk_entry_get_text(GTK_ENTRY(d->entry_host))); - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(d->transport_tcp_ip))) { - binding->transport = NCACN_IP_TCP; - } else if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(d->transport_ncalrpc))) { - binding->transport = NCALRPC; - binding->host = NULL; - } else { - binding->transport = NCACN_NP; - } - - binding->options = NULL; - binding->flags = 0; - binding->endpoint = NULL; - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(d->chk_seal))) { - binding->flags |= DCERPC_SEAL; - } - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(d->chk_sign))) { - binding->flags |= DCERPC_SIGN; - } - - return binding; -} - -const char *gtk_rpc_binding_dialog_get_binding_string(GtkRpcBindingDialog *d, TALLOC_CTX *mem_ctx) -{ - return dcerpc_binding_string(mem_ctx, gtk_rpc_binding_dialog_get_binding(d, mem_ctx)); -} - -GtkWidget *create_gtk_samba_about_dialog (const char *appname) -{ - GtkWidget *samba_about_dialog; - GtkWidget *dialog_vbox1; - GtkWidget *label1; - GtkWidget *label2; - GtkWidget *label3; - GtkWidget *label4; - GtkWidget *dialog_action_area1; - GtkWidget *okbutton1; - - samba_about_dialog = gtk_dialog_new (); - gtk_window_set_title (GTK_WINDOW (samba_about_dialog), "About"); - - dialog_vbox1 = GTK_DIALOG (samba_about_dialog)->vbox; - - /* FIXME image1 = create_pixmap (samba_about_dialog, "slmed.png"); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), image1, TRUE, TRUE, 0);*/ - - label1 = gtk_label_new (appname); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), label1, FALSE, FALSE, 0); - - label2 = gtk_label_new (SAMBA_VERSION_STRING); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), label2, FALSE, FALSE, 0); - - label3 = gtk_label_new_with_mnemonic ("Part of Samba <http://www.samba.org/>"); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), label3, FALSE, FALSE, 0); - - label4 = gtk_label_new ("\302\251 1992-2006 The Samba Team"); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), label4, FALSE, FALSE, 0); - - dialog_action_area1 = GTK_DIALOG (samba_about_dialog)->action_area; - gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); - - okbutton1 = gtk_button_new_from_stock ("gtk-ok"); - gtk_dialog_add_action_widget (GTK_DIALOG (samba_about_dialog), okbutton1, GTK_RESPONSE_OK); - GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT); - gtk_widget_show_all(dialog_vbox1); - - return samba_about_dialog; -} diff --git a/source4/gtk/common/gtk-smb.h b/source4/gtk/common/gtk-smb.h deleted file mode 100644 index ae72905272..0000000000 --- a/source4/gtk/common/gtk-smb.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - Unix SMB/CIFS implementation. - SMB-related GTK+ functions - - Copyright (C) Jelmer Vernooij 2004 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#ifndef __GTK_SMB_H__ -#define __GTK_SMB_H__ - -#define GTK_DISABLE_DEPRECATED -#include <gtk/gtk.h> - -typedef struct _GtkRpcBindingDialog GtkRpcBindingDialog; - -struct _GtkRpcBindingDialog -{ - GtkDialog dialog; - GtkWidget *chk_sign; - GtkWidget *chk_seal; - GtkWidget *transport_tcp_ip; - GtkWidget *transport_ncalrpc; - GtkWidget *transport_smb; - GtkWidget *frame_host; - GtkWidget *entry_host; - GtkWidget *entry_username; - GtkWidget *entry_userdomain; - GtkWidget *entry_password; - GtkWidget *krb5_chk_button; - TALLOC_CTX *mem_ctx; - struct dcerpc_pipe *sam_pipe; -}; - -typedef struct _GtkRpcBindingDialogClass GtkRpcBindingDialogClass; - -struct _GtkRpcBindingDialogClass -{ - GtkDialogClass parent_class; -}; - -#define GTK_RPC_BINDING_DIALOG(obj) GTK_CHECK_CAST (obj, gtk_rpc_binding_dialog_get_type (), GtkRpcBindingDialog) -#define GTK_RPC_BINDING_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_rpc_binding_dialog_class_get_type (), GtkRpcBindingDialogClass) -#define IS_GTK_RPC_BINDING_DIALOG(obj) GTK_CHECK_TYPE (obj, gtk_rpc_binding_dialog_get_type ()) - -/* subsystem prototypes */ -GtkWidget *create_gtk_samba_about_dialog (const char *appname); -void gtk_show_ntstatus(GtkWidget *win, const char *, NTSTATUS status); -GtkWidget *gtk_rpc_binding_dialog_new (struct dcerpc_pipe *sam_pipe); -GType gtk_rpc_binding_dialog_get_type (void); -struct dcerpc_binding *gtk_rpc_binding_dialog_get_binding(GtkRpcBindingDialog *d, TALLOC_CTX *mem_ctx); -void gtk_show_werror(GtkWidget *win, const char *, WERROR err); -const char *gtk_rpc_binding_dialog_get_binding_string(GtkRpcBindingDialog *d, TALLOC_CTX *mem_ctx); -const char *gtk_rpc_binding_dialog_get_host(GtkRpcBindingDialog *d); - -int gtk_event_loop(void); -struct event_context; -struct event_context *gtk_event_context(void); - -struct cli_credentials; -void cli_credentials_set_gtk_callbacks(struct cli_credentials *creds); - -#endif diff --git a/source4/gtk/common/gtk_events.c b/source4/gtk/common/gtk_events.c deleted file mode 100644 index 45e1031093..0000000000 --- a/source4/gtk/common/gtk_events.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - Unix SMB/CIFS implementation. - - main select loop and event handling - - plugin for using a gtk application's event loop - - Copyright (C) Stefan Metzmacher 2005 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include "includes.h" -#include "lib/events/events.h" -#include "lib/events/events_internal.h" - -#include "gtk/common/select.h" - -/* as gtk_main() doesn't take a parameter nor return one, - we need to have a global event context structure for our - gtk-bases tools - */ -static struct event_context *gtk_event_context_global; - -static int gtk_event_context_destructor(struct event_context *ev) -{ - gtk_event_context_global = NULL; - return 0; -} - -/* - create a gtk_event_context structure. -*/ -static int gtk_event_context_init(struct event_context *ev) -{ - talloc_set_destructor(ev, gtk_event_context_destructor); - return 0; -} - -struct gtk_fd_event { - BOOL running; - BOOL free_after_run; - GIOChannel *channel; - guint fd_id; -}; - -static gboolean gtk_event_fd_handler(GIOChannel *source, GIOCondition condition, gpointer data) -{ - struct fd_event *fde = talloc_get_type(data, struct fd_event); - struct gtk_fd_event *gtk_fd = talloc_get_type(fde->additional_data, - struct gtk_fd_event); - int flags = 0; - - if (condition & (G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP)) - flags |= EVENT_FD_READ; - if (condition & G_IO_OUT) - flags |= EVENT_FD_WRITE; - - gtk_fd->running = True; - fde->handler(fde->event_ctx, fde, flags, fde->private_data); - gtk_fd->running = False; - - if (gtk_fd->free_after_run) { - talloc_free(fde); - return gtk_false(); - } - - return gtk_true(); -} - -/* - destroy an fd_event -*/ -static int gtk_event_fd_destructor(struct fd_event *fde) -{ - struct gtk_fd_event *gtk_fd = talloc_get_type(fde->additional_data, - struct gtk_fd_event); - - if (gtk_fd->running) { - /* the event is running reject the talloc_free() - as it's done by the gtk_event_timed_handler() - */ - gtk_fd->free_after_run = True; - return -1; - } - - if (fde->flags) { - /* only if any flag is set we have really registered an event */ - g_source_remove(gtk_fd->fd_id); - } - g_io_channel_unref(gtk_fd->channel); - - return 0; -} - -/* - add a fd based event - return NULL on failure (memory allocation error) -*/ -static struct fd_event *gtk_event_add_fd(struct event_context *ev, TALLOC_CTX *mem_ctx, - int fd, uint16_t flags, - event_fd_handler_t handler, - void *private_data) -{ - struct fd_event *fde; - struct gtk_fd_event *gtk_fd; - GIOChannel *channel; - guint fd_id = 0; - GIOCondition condition = 0; - - fde = talloc(mem_ctx?mem_ctx:ev, struct fd_event); - if (!fde) return NULL; - - gtk_fd = talloc(fde, struct gtk_fd_event); - if (gtk_fd == NULL) { - talloc_free(fde); - return NULL; - } - - fde->event_ctx = ev; - fde->fd = fd; - fde->flags = flags; - fde->handler = handler; - fde->private_data = private_data; - fde->additional_flags = 0; - fde->additional_data = gtk_fd; - - channel = g_io_channel_unix_new(fde->fd); - if (channel == NULL) { - talloc_free(fde); - return NULL; - } - - if (fde->flags & EVENT_FD_READ) - condition |= (G_IO_IN | G_IO_ERR | G_IO_HUP); - if (fde->flags & EVENT_FD_WRITE) - condition |= G_IO_OUT; - - if (condition) { - /* only register the event when at least one flag is set - as condition == 0 means wait for any event and is not the same - as fde->flags == 0 ! - */ - fd_id = g_io_add_watch(channel, condition, gtk_event_fd_handler, fde); - } - - gtk_fd->running = False; - gtk_fd->free_after_run = False; - gtk_fd->channel = channel; - gtk_fd->fd_id = fd_id; - - talloc_set_destructor(fde, gtk_event_fd_destructor); - - return fde; -} - -/* - return the fd event flags -*/ -static uint16_t gtk_event_get_fd_flags(struct fd_event *fde) -{ - return fde->flags; -} - -/* - set the fd event flags -*/ -static void gtk_event_set_fd_flags(struct fd_event *fde, uint16_t flags) -{ - struct gtk_fd_event *gtk_fd = talloc_get_type(fde->additional_data, - struct gtk_fd_event); - GIOCondition condition = 0; - - if (fde->flags == flags) return; - - if (flags & EVENT_FD_READ) - condition |= (G_IO_IN | G_IO_ERR | G_IO_HUP); - if (flags & EVENT_FD_WRITE) - condition |= G_IO_OUT; - - /* only register the event when at least one flag is set - as condition == 0 means wait for any event and is not the same - as fde->flags == 0 ! - */ - if (fde->flags) { - g_source_remove(gtk_fd->fd_id); - } - if (condition) { - gtk_fd->fd_id = g_io_add_watch(gtk_fd->channel, condition, gtk_event_fd_handler, fde); - } - - fde->flags = flags; -} - -struct gtk_timed_event { - guint te_id; -}; - -/* - destroy a timed event -*/ -static int gtk_event_timed_destructor(struct timed_event *te) -{ - struct gtk_timed_event *gtk_te = talloc_get_type(te->additional_data, - struct gtk_timed_event); - - g_source_remove(gtk_te->te_id); - - return 0; -} - -static int gtk_event_timed_deny_destructor(struct timed_event *te) -{ - return -1; -} - -static gboolean gtk_event_timed_handler(gpointer data) -{ - struct timed_event *te = talloc_get_type(data, struct timed_event); - struct timeval t = timeval_current(); - - /* deny the handler to free the event */ - talloc_set_destructor(te, gtk_event_timed_deny_destructor); - te->handler(te->event_ctx, te, t, te->private_data); - - talloc_set_destructor(te, gtk_event_timed_destructor); - talloc_free(te); - - /* return FALSE mean this event should be removed */ - return gtk_false(); -} - -/* - add a timed event - return NULL on failure (memory allocation error) -*/ -static struct timed_event *gtk_event_add_timed(struct event_context *ev, TALLOC_CTX *mem_ctx, - struct timeval next_event, - event_timed_handler_t handler, - void *private_data) -{ - struct timed_event *te; - struct gtk_timed_event *gtk_te; - struct timeval cur_tv, diff_tv; - guint timeout; - - te = talloc(mem_ctx?mem_ctx:ev, struct timed_event); - if (te == NULL) return NULL; - - gtk_te = talloc(te, struct gtk_timed_event); - if (gtk_te == NULL) { - talloc_free(te); - return NULL; - } - - te->event_ctx = ev; - te->next_event = next_event; - te->handler = handler; - te->private_data = private_data; - te->additional_data = gtk_te; - - cur_tv = timeval_current(); - diff_tv = timeval_until(&cur_tv, &next_event); - timeout = ((diff_tv.tv_usec+999)/1000)+(diff_tv.tv_sec*1000); - - gtk_te->te_id = g_timeout_add(timeout, gtk_event_timed_handler, te); - - talloc_set_destructor(te, gtk_event_timed_destructor); - - return te; -} - -/* - do a single event loop -*/ -static int gtk_event_loop_once(struct event_context *ev) -{ - /* - * gtk_main_iteration () - * - * gboolean gtk_main_iteration (void); - * - * Runs a single iteration of the mainloop. If no events - * are waiting to be processed GTK+ will block until the - * next event is noticed. If you don't want to block look - * at gtk_main_iteration_do() or check if any events are - * pending with gtk_events_pending() first. - * - * Returns : TRUE if gtk_main_quit() has been called for the innermost mainloop. - */ - gboolean ret; - - ret = gtk_main_iteration(); - if (ret == gtk_true()) { - return -1; - } - - return 0; -} - -/* - return with 0 -*/ -static int gtk_event_loop_wait(struct event_context *ev) -{ - /* - * gtk_main () - * - * void gtk_main (void); - * - * Runs the main loop until gtk_main_quit() is called. - * You can nest calls to gtk_main(). In that case - * gtk_main_quit() will make the innermost invocation - * of the main loop return. - */ - gtk_main(); - return 0; -} - -static const struct event_ops gtk_event_ops = { - .context_init = gtk_event_context_init, - .add_fd = gtk_event_add_fd, - .get_fd_flags = gtk_event_get_fd_flags, - .set_fd_flags = gtk_event_set_fd_flags, - .add_timed = gtk_event_add_timed, - .loop_once = gtk_event_loop_once, - .loop_wait = gtk_event_loop_wait, -}; - -int gtk_event_loop(void) -{ - int ret; - - event_register_backend("gtk", >k_event_ops); - - gtk_event_context_global = event_context_init_byname(NULL, "gtk"); - if (!gtk_event_context_global) return -1; - - ret = event_loop_wait(gtk_event_context_global); - - talloc_free(gtk_event_context_global); - - return ret; -} - -struct event_context *gtk_event_context(void) -{ - return gtk_event_context_global; -} diff --git a/source4/gtk/common/select.c b/source4/gtk/common/select.c deleted file mode 100644 index 5a0480ab28..0000000000 --- a/source4/gtk/common/select.c +++ /dev/null @@ -1,305 +0,0 @@ -/* - Unix SMB/CIFS implementation. - SMB-related GTK+ functions - - Copyright (C) Jelmer Vernooij 2004 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include "includes.h" -#include "librpc/gen_ndr/ndr_samr_c.h" -#include "gtk/common/select.h" -#include "gtk/common/gtk-smb.h" -#include "auth/credentials/credentials.h" - -/* GtkSelectDomainDialog */ - -const char *gtk_select_domain_dialog_get_domain(GtkSelectDomainDialog *d) -{ - return gtk_entry_get_text(GTK_ENTRY(d->entry_domain)); -} - -static void gtk_select_domain_dialog_init (GtkSelectDomainDialog *select_domain_dialog) -{ - GtkWidget *dialog_vbox1; - GtkWidget *hbox1; - GtkWidget *label1; - GtkWidget *scrolledwindow1; - GtkWidget *dialog_action_area1; - GtkWidget *cancelbutton1; - GtkWidget *okbutton1; - GtkCellRenderer *renderer; - GtkTreeViewColumn *curcol; - - gtk_window_set_title (GTK_WINDOW (select_domain_dialog), "Select Domain"); - - dialog_vbox1 = GTK_DIALOG (select_domain_dialog)->vbox; - - hbox1 = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), hbox1, TRUE, TRUE, 0); - - label1 = gtk_label_new ("Domain:"); - gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 0); - - select_domain_dialog->entry_domain = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (hbox1), select_domain_dialog->entry_domain, TRUE, TRUE, 0); - - scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); - gtk_box_pack_start (GTK_BOX (dialog_vbox1), scrolledwindow1, TRUE, TRUE, 0); - - select_domain_dialog->list_domains = gtk_tree_view_new (); - gtk_container_add (GTK_CONTAINER (scrolledwindow1), select_domain_dialog->list_domains); - - curcol = gtk_tree_view_column_new (); - gtk_tree_view_column_set_title(curcol, "Name"); - renderer = gtk_cell_renderer_text_new(); - gtk_tree_view_column_pack_start(curcol, renderer, True); - gtk_tree_view_append_column(GTK_TREE_VIEW(select_domain_dialog->list_domains), curcol); - gtk_tree_view_column_add_attribute(curcol, renderer, "text", 0); - - select_domain_dialog->store_domains = gtk_list_store_new(1, G_TYPE_STRING); - gtk_tree_view_set_model(GTK_TREE_VIEW(select_domain_dialog->list_domains), GTK_TREE_MODEL(select_domain_dialog->store_domains)); - g_object_unref(select_domain_dialog->store_domains); - - dialog_action_area1 = GTK_DIALOG (select_domain_dialog)->action_area; - gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); - - cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_dialog_add_action_widget (GTK_DIALOG (select_domain_dialog), cancelbutton1, GTK_RESPONSE_CANCEL); - GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT); - - okbutton1 = gtk_button_new_from_stock ("gtk-ok"); - gtk_dialog_add_action_widget (GTK_DIALOG (select_domain_dialog), okbutton1, GTK_RESPONSE_OK); - gtk_widget_show_all(dialog_vbox1); - GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT); -} - -struct policy_handle gtk_select_domain_dialog_get_handle(GtkSelectDomainDialog *d) -{ - struct policy_handle h; - - - /* FIXME */ - return h; -} - -GType gtk_select_domain_dialog_get_type (void) -{ - static GType mytype = 0; - - if (!mytype) - { - static const GTypeInfo myinfo = - { - sizeof (GtkSelectDomainDialogClass), - NULL, - NULL, - NULL, - NULL, - NULL, - sizeof(GtkSelectDomainDialog), - 0, - (GInstanceInitFunc) gtk_select_domain_dialog_init, - }; - - mytype = g_type_register_static (GTK_TYPE_DIALOG, - "GtkSelectDomainDialog", &myinfo, 0); - } - - return mytype; -} - -GtkWidget *gtk_select_domain_dialog_new (struct dcerpc_pipe *sam_pipe) -{ - GtkSelectDomainDialog *d = g_object_new(gtk_select_domain_dialog_get_type (), NULL); - NTSTATUS status; - struct samr_EnumDomains r; - struct samr_Connect cr; - struct samr_Close dr; - struct policy_handle handle; - uint32_t resume_handle = 0; - int i; - TALLOC_CTX *mem_ctx = talloc_init("gtk_select_domain_dialog_new"); - - d->sam_pipe = sam_pipe; - - cr.in.system_name = 0; - cr.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; - cr.out.connect_handle = &handle; - - status = dcerpc_samr_Connect(sam_pipe, mem_ctx, &cr); - if (!NT_STATUS_IS_OK(status)) { - gtk_show_ntstatus(NULL, "Running Connect on SAMR", status); - talloc_free(mem_ctx); - return GTK_WIDGET(d); - } - - r.in.connect_handle = &handle; - r.in.resume_handle = &resume_handle; - r.in.buf_size = (uint32_t)-1; - r.out.resume_handle = &resume_handle; - - status = dcerpc_samr_EnumDomains(sam_pipe, mem_ctx, &r); - if (!NT_STATUS_IS_OK(status)) { - gtk_show_ntstatus(NULL, "Enumerating domains", status); - } else if (r.out.sam) { - for (i=0;i<r.out.sam->count;i++) { - GtkTreeIter iter; - gtk_list_store_append(d->store_domains, &iter); - gtk_list_store_set (d->store_domains, &iter, 0, r.out.sam->entries[i].name.string, -1); - } - } - - dr.in.handle = &handle; - dr.out.handle = &handle; - - status = dcerpc_samr_Close(sam_pipe, mem_ctx, &dr); - if (!NT_STATUS_IS_OK(status)) { - gtk_show_ntstatus(NULL, "Closing SAMR connection", status); - talloc_free(mem_ctx); - return GTK_WIDGET ( d ); - } - - talloc_free(mem_ctx); - - return GTK_WIDGET ( d ); -} - - -/* GtkSelectHostDialog */ -const char *gtk_select_host_dialog_get_host (GtkSelectHostDialog *d) -{ - return gtk_entry_get_text(GTK_ENTRY(d->entry_host)); -} - -static void gtk_select_host_dialog_init (GtkSelectHostDialog *select_host_dialog) -{ - GtkWidget *dialog_vbox2; - GtkWidget *hbox2; - GtkWidget *label2; - GtkWidget *scrolledwindow2; - GtkWidget *dialog_action_area2; - GtkWidget *cancelbutton2; - GtkWidget *okbutton2; - - gtk_window_set_title (GTK_WINDOW (select_host_dialog), "Select Host"); - - dialog_vbox2 = GTK_DIALOG (select_host_dialog)->vbox; - - hbox2 = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (dialog_vbox2), hbox2, TRUE, TRUE, 0); - - label2 = gtk_label_new ("Host"); - gtk_box_pack_start (GTK_BOX (hbox2), label2, FALSE, FALSE, 0); - - select_host_dialog->entry_host = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (hbox2), select_host_dialog->entry_host, TRUE, TRUE, 0); - - scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL); - gtk_box_pack_start (GTK_BOX (dialog_vbox2), scrolledwindow2, TRUE, TRUE, 0); - - select_host_dialog->tree_host = gtk_tree_view_new (); - gtk_container_add (GTK_CONTAINER (scrolledwindow2), select_host_dialog->tree_host); - - select_host_dialog->store_host = gtk_tree_store_new(1, G_TYPE_STRING); - gtk_tree_view_set_model(GTK_TREE_VIEW(select_host_dialog->tree_host), GTK_TREE_MODEL(select_host_dialog->store_host)); - g_object_unref(select_host_dialog->store_host); - - dialog_action_area2 = GTK_DIALOG (select_host_dialog)->action_area; - gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area2), GTK_BUTTONBOX_END); - - cancelbutton2 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_dialog_add_action_widget (GTK_DIALOG (select_host_dialog), cancelbutton2, GTK_RESPONSE_CANCEL); - GTK_WIDGET_SET_FLAGS (cancelbutton2, GTK_CAN_DEFAULT); - - okbutton2 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_show_all (dialog_vbox2); - gtk_dialog_add_action_widget (GTK_DIALOG (select_host_dialog), okbutton2, GTK_RESPONSE_OK); - GTK_WIDGET_SET_FLAGS (okbutton2, GTK_CAN_DEFAULT); -} - -GType gtk_select_host_dialog_get_type (void) -{ - static GType mytype = 0; - - if (!mytype) - { - static const GTypeInfo myinfo = - { - sizeof (GtkSelectHostDialogClass), - NULL, - NULL, - NULL, - NULL, - NULL, - sizeof(GtkSelectHostDialog), - 0, - (GInstanceInitFunc) gtk_select_host_dialog_init, - }; - - mytype = g_type_register_static (GTK_TYPE_DIALOG, - "GtkSelectHostDialog", &myinfo, 0); - } - - return mytype; -} - -GtkWidget *gtk_select_host_dialog_new (struct dcerpc_pipe *sam_pipe) -{ - return GTK_WIDGET ( g_object_new (gtk_select_host_dialog_get_type (), NULL )); -} - -/** - * Connect to a specific interface, but ask the user - * for information not specified - */ -struct dcerpc_pipe *gtk_connect_rpc_interface(TALLOC_CTX *mem_ctx, const struct dcerpc_interface_table *table) -{ - GtkRpcBindingDialog *d; - NTSTATUS status; - struct dcerpc_pipe *pipe; - struct cli_credentials *cred; - gint result; - - d = GTK_RPC_BINDING_DIALOG(gtk_rpc_binding_dialog_new(NULL)); - result = gtk_dialog_run(GTK_DIALOG(d)); - - if (result != GTK_RESPONSE_ACCEPT) { - gtk_widget_destroy(GTK_WIDGET(d)); - return NULL; - } - - cred = cli_credentials_init(mem_ctx); - cli_credentials_guess(cred); - cli_credentials_set_gtk_callbacks(cred); - - status = dcerpc_pipe_connect_b(mem_ctx, &pipe, - gtk_rpc_binding_dialog_get_binding(d, mem_ctx), - table, cred, NULL); - - if(!NT_STATUS_IS_OK(status)) { - gtk_show_ntstatus(NULL, "While connecting to interface", status); - gtk_widget_destroy(GTK_WIDGET(d)); - talloc_free(cred); - return NULL; - } - - gtk_widget_destroy(GTK_WIDGET(d)); - - talloc_free(cred); - - return pipe; -} diff --git a/source4/gtk/common/select.h b/source4/gtk/common/select.h deleted file mode 100644 index ddf9b1a5a9..0000000000 --- a/source4/gtk/common/select.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - Unix SMB/CIFS implementation. - SMB-related GTK+ functions - - Copyright (C) Jelmer Vernooij 2004 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#ifndef __GTK_SELECT_H__ -#define __GTK_SELECT_H__ - -#define GTK_DISABLE_DEPRECATED -#include <gtk/gtk.h> - -typedef struct _GtkSelectDomainDialog GtkSelectDomainDialog; - -struct _GtkSelectDomainDialog -{ - GtkDialog dialog; - GtkWidget *entry_domain; - GtkWidget *list_domains; - GtkListStore *store_domains; - TALLOC_CTX *mem_ctx; - struct dcerpc_pipe *sam_pipe; -}; - -typedef struct _GtkSelectDomainDialogClass GtkSelectDomainDialogClass; - -struct _GtkSelectDomainDialogClass -{ - GtkDialogClass parent_class; -}; - -#define GTK_SELECT_DOMAIN_DIALOG(obj) GTK_CHECK_CAST (obj, gtk_select_domain_dialog_get_type (), GtkSelectDomainDialog) -#define GTK_SELECT_DOMAIN_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_select_domain_dialog_class_get_type (), GtkSelectDomainDialogClass) -#define IS_GTK_SELECT_DOMAIN_DIALOG(obj) GTK_CHECK_TYPE (obj, gtk_select_domain_dialog_get_type ()) - -typedef struct _GtkSelectHostDialog GtkSelectHostDialog; - -struct _GtkSelectHostDialog -{ - GtkDialog dialog; - GtkWidget *entry_host; - GtkWidget *tree_host; - GtkTreeStore *store_host; - struct dcerpc_pipe *sam_pipe; - TALLOC_CTX *mem_ctx; -}; - -typedef struct _GtkSelectHostDialogClass GtkSelectHostDialogClass; - -struct _GtkSelectHostDialogClass -{ - GtkDialogClass parent_class; -}; - -#define GTK_SELECT_HOST_DIALOG(obj) GTK_CHECK_CAST (obj, gtk_select_host_dialog_get_type (), GtkSelectHostDialog) -#define GTK_SELECT_HOST_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_select_host_dialog_class_get_type (), GtkSelectHostDialogClass) -#define IS_GTK_SELECT_HOST_DIALOG(obj) GTK_CHECK_TYPE (obj, gtk_select_host_dialog_get_type ()) - -GtkWidget *gtk_select_domain_dialog_new (struct dcerpc_pipe *sam_pipe); -GType gtk_select_domain_dialog_get_type (void); -struct policy_handle gtk_select_domain_dialog_get_handle(GtkSelectDomainDialog *d); -GtkWidget *gtk_select_host_dialog_new (struct dcerpc_pipe *sam_pipe); -const char *gtk_select_host_dialog_get_host (GtkSelectHostDialog *d); -GType gtk_select_host_dialog_get_type (void); - -struct dcerpc_interface_table; -struct dcerpc_pipe *gtk_connect_rpc_interface(TALLOC_CTX *mem_ctx, const struct dcerpc_interface_table *table); - -#endif |