File: bu_command.h

package info (click to toggle)
pcb-rnd 2.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 29,260 kB
  • sloc: ansic: 198,059; sh: 5,767; yacc: 5,568; makefile: 2,519; awk: 1,737; lex: 1,073; python: 519; lisp: 169; tcl: 67; xml: 40; perl: 34; ruby: 5
file content (36 lines) | stat: -rw-r--r-- 1,099 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef PCB_GTK_DLG_COMMAND_H
#define PCB_GTK_DLG_COMMAND_H

#include <gtk/gtk.h>
#include <glib.h>
#include "pcb_bool.h"
#include "glue.h"

typedef struct pcb_gtk_command_s {
	GtkWidget *command_combo_box, *prompt_label;
	GtkEntry *command_entry;
	gboolean command_entry_status_line_active;

	void (*pack_in_status_line)(void); /* embed the command combo box in top window's status line */
	void (*post_entry)(void);
	void (*pre_entry)(void);

	pcb_gtk_common_t *com;

	/* internal */
	GMainLoop *ghid_entry_loop;
	gchar *command_entered;
} pcb_gtk_command_t;

void ghid_handle_user_command(pcb_gtk_command_t *ctx, pcb_bool raise);
char *ghid_command_entry_get(pcb_gtk_command_t *ctx, const char *prompt, const char *command);

/* Update the prompt text before the command entry - call it when any of conf_core.rc.cli_* change */
void ghid_command_update_prompt(pcb_gtk_command_t *ctx);

const char *pcb_gtk_cmd_command_entry(pcb_gtk_command_t *ctx, const char *ovr, int *cursor);

/* cancel editing and quit the main loop - NOP if not active*/
void ghid_cmd_close(pcb_gtk_command_t *ctx);

#endif