CuiGenerator

Name

CuiGenerator -- 

Synopsis


#include <history.h>


            CuiGenerator;
CuiGenerator* cui_generator_new             (void);
void        cui_generator_set_terminal      (CuiGenerator *generator,
                                             const gpointer *terminal);
void        cui_generator_send_shell_command
                                            (CuiGenerator *generator,
                                             const char *command);
enum        CuiCommandType;
enum        CuiCommandOpcode;
void        cui_generator_emit_file_command (CuiGenerator *generator,
                                             CuiCommandOpcode command,
                                             CuiFilename *file);
void        cui_generator_emit_file_command_with_arg
                                            (CuiGenerator *generator,
                                             CuiCommandOpcode command,
                                             CuiFilename *file,
                                             const gchar *text);
gint        cui_generator_emit_commands     (CuiGenerator *command_generator,
                                             GList *list);

Object Hierarchy


  GObject
   +----CuiGenerator

Properties


  "os"                   gchararray            : Read / Write
  "terminal"             gpointer              : Read / Write

Description

Details

CuiGenerator

typedef struct {
	gpointer     terminal;
	gchar       *os;
} CuiGenerator;

gpointer terminal;

we send the command for this Terminal

gchar *os;

the name of the operating system


cui_generator_new ()

CuiGenerator* cui_generator_new             (void);

Returns :

A newly allocated and initialized command generator


cui_generator_set_terminal ()

void        cui_generator_set_terminal      (CuiGenerator *generator,
                                             const gpointer *terminal);

Sets the terminal for the command generator.

generator :

a CuiGenerator

terminal :

a Terminal we send the commands to


cui_generator_send_shell_command ()

void        cui_generator_send_shell_command
                                            (CuiGenerator *generator,
                                             const char *command);

Sends a command directly to the terminal. This function does not modify the string just sends it to execute.

generator :

a CuiGenerator

command :

a simple shell command


enum CuiCommandType

typedef enum {
	FileCommand,
	FileCommandWithArg,
	WindowCommand,
	WindowCommandWithArg
} CuiCommandType;

A type to arrange the command opcodes into groups.


enum CuiCommandOpcode

typedef enum {
	FileOpen,
	FileRefresh,
	FileOpenForEdit,
	FileOpenForView,
	FileProcess,
	FileOpenWithVim,
	FileOpenWithEmacs,
	FileNewRegularFile,
	FileNewDirectory,
	FileNewTarArchive,
	FileNewTarGzArchive,
	FileNewTarBzArchive,
	FileDelete,
	FileMoveToTrash,
	FileUncompress,
	FileShowProperties,
	FileClipBoardCut,
	FileClipBoardCopy,
	FileClipBoardPaste,
	FileSetModeToFile,
	FileSetModeToDir,
	FileSetModeToProgram,
	FileViewACLList,
	FileGrantReadUser,
	FileRevokeReadUser,
	FileGrantWriteUser,
	FileRevokeWriteUser,
	FileGrantExecuteUser,
	FileRevokeExecuteUser,
	FileGrantReadGroup,
	FileRevokeReadGroup,
	FileGrantWriteGroup,
	FileRevokeWriteGroup,
	FileGrantExecuteGroup,
	FileRevokeExecuteGroup,
	FileGrantReadOthers,
	FileRevokeReadOthers,
	FileGrantWriteOthers,
	FileRevokeWriteOthers,
	FileGrantExecuteOthers,
	FileRevokeExecuteOthers,
	/* These commands has a char argument accepted when executing. */
	FileRename,               
	FileCopy,
	FileMove,
	FileCopyMode,
	FileCopyOwner,
	FileCopyGroupOwner,
	FileChangeOwner,
	FileChangeGroup,
	FileChangeAccessDate,
	FileChangeModifyDate,
	FileChangeChangeDate, 
	/* These commands has an implicit char argument. */
	FileChangeACL,
	FileOpenWithLine,
	WindowDirectCommand,
	/* Window commands */
	WindowRefresh
} CuiCommandOpcode;

A simple command code.

FileOpen

FileRefresh

FileOpenForEdit

FileOpenForView

FileProcess

FileOpenWithVim

FileOpenWithEmacs

FileNewRegularFile

FileNewDirectory

FileNewTarArchive

FileNewTarGzArchive

FileNewTarBzArchive

FileDelete

FileMoveToTrash

FileUncompress

FileShowProperties

FileClipBoardCut

FileClipBoardCopy

FileClipBoardPaste

FileSetModeToFile

FileSetModeToDir

FileSetModeToProgram

FileViewACLList

View Access Control List entries.

FileGrantReadUser

FileRevokeReadUser

FileGrantWriteUser

FileRevokeWriteUser

FileGrantExecuteUser

FileRevokeExecuteUser

FileGrantReadGroup

FileRevokeReadGroup

FileGrantWriteGroup

FileRevokeWriteGroup

FileGrantExecuteGroup

FileRevokeExecuteGroup

FileGrantReadOthers

FileRevokeReadOthers

FileGrantWriteOthers

FileRevokeWriteOthers

FileGrantExecuteOthers

FileRevokeExecuteOthers

FileRename

These command has a char argument.

FileCopy

FileMove

FileCopyMode

FileCopyOwner

FileCopyGroupOwner

FileChangeOwner

FileChangeGroup

FileChangeAccessDate

FileChangeModifyDate

FileChangeChangeDate

FileChangeACL

FileOpenWithLine

WindowDirectCommand

WindowRefresh

executes the command of the window to refresh the window content


cui_generator_emit_file_command ()

void        cui_generator_emit_file_command (CuiGenerator *generator,
                                             CuiCommandOpcode command,
                                             CuiFilename *file);

Sends a file command with the command generator to the shell.

generator :

a CuiGenerator

command :

the code of the command to send

file :

the file argument for the command


cui_generator_emit_file_command_with_arg ()

void        cui_generator_emit_file_command_with_arg
                                            (CuiGenerator *generator,
                                             CuiCommandOpcode command,
                                             CuiFilename *file,
                                             const gchar *text);

generator :

command :

file :

text :


cui_generator_emit_commands ()

gint        cui_generator_emit_commands     (CuiGenerator *command_generator,
                                             GList *list);

Emits a series of commands to the terminal to execute them.

command_generator :

a CuiGenerator to generate the commands

list :

a list of commands

Returns :

the number of commands executed

Properties

The "os" property

  "os"                   gchararray            : Read / Write

The name of the operating system.

Default value: "Linux"


The "terminal" property

  "terminal"             gpointer              : Read / Write

The terminal to send the generated commands.